(
16 | ({ isRegular, ...props }, ref) =>
17 | );
18 |
19 | Title.displayName = 'Well.Title';
20 |
--------------------------------------------------------------------------------
/packages/tooltips/src/styled/StyledParagraph.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'tooltip.paragraph';
12 |
13 | /**
14 | * Accepts all `` props
15 | */
16 | export const StyledParagraph = styled.p.attrs({
17 | 'data-garden-id': COMPONENT_ID,
18 | 'data-garden-version': PACKAGE_VERSION
19 | })`
20 | margin: 0;
21 |
22 | ${componentStyles};
23 | `;
24 |
--------------------------------------------------------------------------------
/packages/notifications/src/elements/Paragraph.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Paragraph } from './Paragraph';
11 |
12 | describe('Paragraph', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/notifications/src/styled/global-alert/StyledGlobalAlertContent.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'notifications.global_alert.content';
12 |
13 | export const StyledGlobalAlertContent = styled.div.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | flex-grow: 1;
18 |
19 | ${componentStyles};
20 | `;
21 |
--------------------------------------------------------------------------------
/packages/notifications/src/styled/global-alert/index.ts:
--------------------------------------------------------------------------------
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 |
8 | export { StyledGlobalAlert } from './StyledGlobalAlert';
9 | export { StyledGlobalAlertButton } from './StyledGlobalAlertButton';
10 | export { StyledGlobalAlertClose } from './StyledGlobalAlertClose';
11 | export { StyledGlobalAlertContent } from './StyledGlobalAlertContent';
12 | export { StyledGlobalAlertIcon } from './StyledGlobalAlertIcon';
13 | export { StyledGlobalAlertTitle } from './StyledGlobalAlertTitle';
14 |
--------------------------------------------------------------------------------
/packages/pagination/src/elements/OffsetPagination/components/Gap.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Gap } from './Gap';
11 |
12 | describe('Gap', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstElementChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/tables/src/styled/StyledHiddenCell.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { hideVisually } from 'polished';
10 | import { componentStyles } from '@zendeskgarden/react-theming';
11 |
12 | const COMPONENT_ID = 'tables.hidden_cell';
13 |
14 | export const StyledHiddenCell = styled.div.attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${hideVisually()}
19 |
20 | ${componentStyles};
21 | `;
22 |
--------------------------------------------------------------------------------
/packages/tooltips/src/elements/Title.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { forwardRef, HTMLAttributes } from 'react';
9 | import { StyledTitle } from '../styled';
10 |
11 | /**
12 | * @deprecated use `Tooltip.Title` instead
13 | *
14 | * @extends HTMLAttributes
15 | */
16 | export const Title = forwardRef>((props, ref) => (
17 |
18 | ));
19 |
20 | Title.displayName = 'Tooltip.Title';
21 |
--------------------------------------------------------------------------------
/packages/typography/src/styled/StyledCodeBlockContainer.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { StyledCodeBlockContainer } from './StyledCodeBlockContainer';
11 |
12 | describe('StyledCodeBlockContainer', () => {
13 | it('renders the expected element', () => {
14 | const { container } = render();
15 |
16 | expect(container.firstChild!.nodeName).toBe('DIV');
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/footer/FooterItem.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { FooterItem } from './FooterItem';
11 |
12 | describe('FooterItem', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/nav/NavItemText.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { NavItemText } from './NavItemText';
11 |
12 | describe('NavItemText', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/sheet/components/Footer.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 |
11 | import { Footer } from './Footer';
12 |
13 | describe('Sheet.Footer', () => {
14 | it('passes ref to underlying DOM element', () => {
15 | const ref = React.createRef();
16 | const { container } = render();
17 |
18 | expect(container.firstChild).toBe(ref.current);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/sheet/components/Header.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 |
11 | import { Header } from './Header';
12 |
13 | describe('Sheet.Header', () => {
14 | it('passes ref to underlying DOM element', () => {
15 | const ref = React.createRef();
16 | const { container } = render();
17 |
18 | expect(container.firstChild).toBe(ref.current);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/views/combobox/StyledMessage.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { Field } from '@zendeskgarden/react-forms';
11 |
12 | const COMPONENT_ID = 'dropdowns.combobox.message';
13 |
14 | export const StyledMessage = styled(Field.Message).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/forms/src/styled/checkbox/StyledCheckHint.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledRadioHint } from '../radio/StyledRadioHint';
11 |
12 | const COMPONENT_ID = 'forms.checkbox_hint';
13 |
14 | export const StyledCheckHint = styled(StyledRadioHint).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/notifications/src/elements/alert/Paragraph.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Paragraph } from './Paragraph';
11 |
12 | describe('Paragraph', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/notifications/src/elements/well/Paragraph.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Paragraph } from './Paragraph';
11 |
12 | describe('Paragraph', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/avatars/src/elements/components/Text.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { forwardRef, HTMLAttributes } from 'react';
9 | import { StyledText } from '../../styled';
10 |
11 | const TextComponent = forwardRef>((props, ref) => (
12 |
13 | ));
14 |
15 | TextComponent.displayName = 'Avatar.Text';
16 |
17 | /**
18 | * @extends HTMLAttributes
19 | */
20 | export const Text = TextComponent;
21 |
--------------------------------------------------------------------------------
/packages/colorpickers/src/index.ts:
--------------------------------------------------------------------------------
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 |
8 | export { ColorPicker } from './elements/ColorPicker';
9 | export { ColorPickerDialog } from './elements/ColorPickerDialog';
10 | export { ColorSwatch } from './elements/ColorSwatch';
11 | export { ColorSwatchDialog } from './elements/ColorSwatchDialog';
12 |
13 | export type {
14 | IColor,
15 | IColorPickerProps,
16 | IColorPickerDialogProps,
17 | ILabeledColor,
18 | IColorSwatchProps,
19 | IColorSwatchDialogProps
20 | } from './types';
21 |
--------------------------------------------------------------------------------
/packages/draggable/src/styled/draggable/StyledContent.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'draggable.content';
12 |
13 | export const StyledContent = styled.div.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | flex: 1;
18 | word-wrap: break-word;
19 | overflow-wrap: anywhere;
20 |
21 | ${componentStyles};
22 | `;
23 |
--------------------------------------------------------------------------------
/packages/dropdowns.legacy/src/elements/Menu/Items/HeaderIcon.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { HTMLAttributes } from 'react';
9 | import { StyledHeaderIcon } from '../../../styled';
10 |
11 | /**
12 | * @extends HTMLAttributes
13 | */
14 | export const HeaderIcon = React.forwardRef>(
15 | (props, ref) => {
16 | return ;
17 | }
18 | );
19 |
20 | HeaderIcon.displayName = 'HeaderIcon';
21 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/views/menu/StyledItemGroup.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledOptGroup } from '../combobox/StyledOptGroup';
11 |
12 | const COMPONENT_ID = 'dropdowns.menu.item_group';
13 |
14 | export const StyledItemGroup = styled(StyledOptGroup).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/modals/src/elements/FooterItem.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { StyledFooterItem } from '../styled';
10 |
11 | /**
12 | * @deprecated use `Modal.FooterItem` instead
13 | *
14 | * @extends HTMLAttributes
15 | */
16 | export const FooterItem = React.forwardRef>(
17 | (props, ref) =>
18 | );
19 |
20 | FooterItem.displayName = 'Modal.FooterItem';
21 |
--------------------------------------------------------------------------------
/packages/pagination/src/elements/OffsetPagination/components/Next.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Next } from './Next';
11 |
12 | describe('Next', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstElementChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/pagination/src/elements/OffsetPagination/components/Page.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { Page } from './Page';
11 |
12 | describe('Page', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstElementChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/tables/src/elements/Body.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { HTMLAttributes, forwardRef } from 'react';
9 | import { StyledBody } from '../styled';
10 |
11 | /**
12 | * @deprecated use `Table.Body` instead
13 | *
14 | * @extends HTMLAttributes
15 | */
16 | export const Body = forwardRef>(
17 | (props, ref) =>
18 | );
19 |
20 | Body.displayName = 'Table.Body';
21 |
--------------------------------------------------------------------------------
/packages/.template/src/styled/Styled{{capitalize component}}Text.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 |
10 | const COMPONENT_ID = '{{pluralize (lowercase component)}}.{{lowercase component}}.text';
11 |
12 | export const Styled{{capitalize component}}Text = styled.span.attrs({
13 | 'data-garden-id': COMPONENT_ID,
14 | 'data-garden-version': PACKAGE_VERSION
15 | })`
16 | display: block;
17 | max-width: 100%;
18 | overflow: hidden;
19 | text-overflow: ellipsis;
20 | `;
21 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/footer/FooterItem.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { HTMLAttributes } from 'react';
9 | import { StyledFooterItem } from '../../styled';
10 |
11 | /**
12 | * @deprecated use `Footer.Item` instead
13 | *
14 | * @extends HTMLAttributes
15 | */
16 | export const FooterItem = React.forwardRef>(
17 | (props, ref) =>
18 | );
19 |
20 | FooterItem.displayName = 'Footer.Item';
21 |
--------------------------------------------------------------------------------
/packages/colorpickers/src/styled/ColorSwatch/StyledCell.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'colorpickers.swatch_cell';
12 |
13 | export const StyledCell = styled.td.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | padding: ${props => props.theme.space.base}px;
18 | font-size: 0;
19 |
20 | ${componentStyles};
21 | `;
22 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/context/useItemContext.ts:
--------------------------------------------------------------------------------
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 |
8 | import { createContext, useContext } from 'react';
9 |
10 | export const ItemContext = createContext<{ isDisabled?: boolean } | undefined>(undefined);
11 |
12 | const useItemContext = () => {
13 | const context = useContext(ItemContext);
14 |
15 | if (!context) {
16 | throw new Error('Error: this component must be rendered within an - .');
17 | }
18 |
19 | return context;
20 | };
21 |
22 | export default useItemContext;
23 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/views/menu/StyledItemIcon.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledOptionIcon } from '../combobox/StyledOptionIcon';
11 |
12 | const COMPONENT_ID = 'dropdowns.menu.item.icon';
13 |
14 | export const StyledItemIcon = styled(StyledOptionIcon).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/views/menu/StyledItemMeta.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledOptionMeta } from '../combobox/StyledOptionMeta';
11 |
12 | const COMPONENT_ID = 'dropdowns.menu.item.meta';
13 |
14 | export const StyledItemMeta = styled(StyledOptionMeta).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/forms/src/styled/checkbox/StyledCheckLabel.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledRadioLabel } from '../radio/StyledRadioLabel';
11 |
12 | const COMPONENT_ID = 'forms.checkbox_label';
13 |
14 | export const StyledCheckLabel = styled(StyledRadioLabel).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/pagination/src/styled/CursorPagination/StyledCursorPagination.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'cursor_pagination';
12 |
13 | export const StyledCursorPagination = styled.nav.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | display: flex;
18 | justify-content: center;
19 |
20 | ${componentStyles};
21 | `;
22 |
--------------------------------------------------------------------------------
/packages/breadcrumbs/src/styled/StyledChevronIcon.tsx:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { em } from 'polished';
10 | import { getColor, StyledBaseIcon } from '@zendeskgarden/react-theming';
11 |
12 | export const StyledChevronIcon = styled(StyledBaseIcon)`
13 | transform: ${p => p.theme.rtl && `rotate(180deg);`};
14 | margin: 0 ${p => em(p.theme.space.base, p.theme.fontSizes.md)};
15 | color: ${p => getColor({ variable: 'foreground.subtle', theme: p.theme })};
16 | `;
17 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/sheet/components/Body.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { forwardRef, HTMLAttributes } from 'react';
9 | import { StyledSheetBody } from '../../../styled';
10 |
11 | const SheetBody = forwardRef>((props, ref) => {
12 | return ;
13 | });
14 |
15 | SheetBody.displayName = 'Sheet.Body';
16 |
17 | /**
18 | * @extends HTMLAttributes
19 | */
20 | export const Body = SheetBody;
21 |
--------------------------------------------------------------------------------
/packages/tables/src/elements/OverflowButton.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { OverflowButton } from './OverflowButton';
11 |
12 | describe('OverflowButton', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/tables/src/styled/StyledCaption.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'tables.caption';
12 |
13 | export const StyledCaption = styled.caption.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | display: table-caption;
18 | text-align: ${props => (props.theme.rtl ? 'right' : 'left')};
19 |
20 | ${componentStyles};
21 | `;
22 |
--------------------------------------------------------------------------------
/packages/theming/src/utils/StyledBaseIcon.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { Children, cloneElement, ReactElement } from 'react';
10 | import { IStyledBaseIconProps } from '../types';
11 |
12 | export const StyledBaseIcon = styled(
13 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
14 | ({ children, theme, ...props }: IStyledBaseIconProps) =>
15 | cloneElement(Children.only(children as ReactElement), props)
16 | )`
17 | /* empty-source */
18 | `;
19 |
--------------------------------------------------------------------------------
/packages/theming/src/utils/getMenuPosition.ts:
--------------------------------------------------------------------------------
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 |
8 | import { Placement } from '@floating-ui/react-dom';
9 | import { MenuPosition } from '../types';
10 |
11 | /**
12 | * Convert Floating-UI placement to a valid `menuStyles` position.
13 | *
14 | * @param {string} placement A Floating-UI placement.
15 | *
16 | * @returns A `menuStyles` position.
17 | */
18 | export const getMenuPosition = (placement: Placement): MenuPosition => {
19 | return placement.split('-')[0] as MenuPosition;
20 | };
21 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/header/HeaderItemText.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 | import { HeaderItemText } from './HeaderItemText';
11 |
12 | describe('HeaderItemText', () => {
13 | it('passes ref to underlying DOM element', () => {
14 | const ref = React.createRef();
15 | const { container } = render();
16 |
17 | expect(container.firstChild).toBe(ref.current);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/chrome/src/elements/sheet/components/FooterItem.spec.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React from 'react';
9 | import { render } from 'garden-test-utils';
10 |
11 | import { FooterItem } from './FooterItem';
12 |
13 | describe('Sheet.FooterItem', () => {
14 | it('passes ref to underlying DOM element', () => {
15 | const ref = React.createRef();
16 | const { container } = render();
17 |
18 | expect(container.firstChild).toBe(ref.current);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/colorpickers/src/styled/ColorPicker/StyledInputGroup.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 |
11 | const COMPONENT_ID = 'colorpickers.colorpicker_input_group';
12 |
13 | export const StyledInputGroup = styled.div.attrs({
14 | 'data-garden-id': COMPONENT_ID,
15 | 'data-garden-version': PACKAGE_VERSION
16 | })`
17 | display: flex;
18 | justify-content: space-between;
19 |
20 | ${componentStyles};
21 | `;
22 |
--------------------------------------------------------------------------------
/packages/dropdowns.legacy/src/elements/Menu/Items/MediaFigure.tsx:
--------------------------------------------------------------------------------
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 |
8 | import React, { HTMLAttributes } from 'react';
9 | import { StyledMediaFigure } from '../../../styled';
10 | import useMenuContext from '../../../utils/useMenuContext';
11 |
12 | /**
13 | * @extends HTMLAttributes
14 | */
15 | export const MediaFigure = (props: HTMLAttributes) => {
16 | const { isCompact } = useMenuContext();
17 |
18 | return ;
19 | };
20 |
--------------------------------------------------------------------------------
/packages/forms/demo/stories/types.ts:
--------------------------------------------------------------------------------
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 |
8 | import { IFileProps } from '@zendeskgarden/react-forms';
9 |
10 | export interface IFileListItem {
11 | text: string;
12 | type?: IFileProps['type'];
13 | remove?: 'close' | 'delete';
14 | value?: number;
15 | }
16 |
17 | export interface IInputGroupItem {
18 | text: string;
19 | isButton: boolean;
20 | }
21 |
22 | export interface ITile {
23 | value: string;
24 | label: string;
25 | description?: string;
26 | disabled?: boolean;
27 | }
28 |
--------------------------------------------------------------------------------
/packages/forms/src/styled/checkbox/StyledCheckMessage.ts:
--------------------------------------------------------------------------------
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 |
8 | import styled from 'styled-components';
9 | import { componentStyles } from '@zendeskgarden/react-theming';
10 | import { StyledRadioMessage } from '../radio/StyledRadioMessage';
11 |
12 | const COMPONENT_ID = 'forms.checkbox_message';
13 |
14 | export const StyledCheckMessage = styled(StyledRadioMessage).attrs({
15 | 'data-garden-id': COMPONENT_ID,
16 | 'data-garden-version': PACKAGE_VERSION
17 | })`
18 | ${componentStyles};
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/typography/demo/paragraph.stories.mdx:
--------------------------------------------------------------------------------
1 | import { Meta, ArgsTable, Canvas, Story, Markdown } from '@storybook/addon-docs';
2 | import { Paragraph } from '@zendeskgarden/react-typography';
3 | import { ParagraphStory } from './stories/ParagraphStory';
4 | import { PARAGRAPH_CHILDREN as CHILDREN } from './stories/data';
5 | import README from '../README.md';
6 |
7 |
8 |
9 | # API
10 |
11 |
12 |
13 | # Demo
14 |
15 |
20 |
21 | {README}
22 |
--------------------------------------------------------------------------------
/packages/dropdowns/src/context/useOptionContext.ts:
--------------------------------------------------------------------------------
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 |
8 | import { createContext, useContext } from 'react';
9 |
10 | export const OptionContext = createContext<{ isDisabled?: boolean } | undefined>(undefined);
11 |
12 | const useOptionContext = () => {
13 | const context = useContext(OptionContext);
14 |
15 | if (!context) {
16 | throw new Error('Error: this component must be rendered within an