index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FooterHelp/FooterHelp.tsx | import React from 'react';
import styles from './FooterHelp.scss';
export interface FooterHelpProps {
/** The content to display inside the layout. */
children?: React.ReactNode;
}
export function FooterHelp({children}: FooterHelpProps) {
return (
<div className={styles.FooterHelp}>
<div className={s... | 9,600 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FooterHelp/index.ts | export * from './FooterHelp';
| 9,601 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FooterHelp | petrpan-code/Shopify/polaris/polaris-react/src/components/FooterHelp/tests/FooterHelp.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {FooterHelp} from '../FooterHelp';
describe('<FooterHelp />', () => {
const children = 'Learn more about fulfilling orders';
it('renders its children', () => {
const footerHelp = mountWithApp(<FooterHelp>{children}</FooterHelp>);... | 9,602 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Form/Form.stories.tsx | import React, {useCallback, useState} from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Button, Checkbox, Form, FormLayout, TextField} from '@shopify/polaris';
export default {
component: Form,
} as ComponentMeta<typeof Form>;
export function CustomOnSubmit() {
const [newsletter, setNewsl... | 9,603 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Form/Form.tsx | import React, {useCallback} from 'react';
import {Text} from '../Text';
import {useI18n} from '../../utilities/i18n';
type Enctype =
| 'application/x-www-form-urlencoded'
| 'multipart/form-data'
| 'text/plain';
type Method = 'post' | 'get' | 'action';
type Target = '_blank' | '_self' | '_parent' | '_top' | st... | 9,604 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Form/index.ts | export * from './Form';
| 9,605 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Form | petrpan-code/Shopify/polaris/polaris-react/src/components/Form/tests/Form.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Form} from '../Form';
const name = 'form-name';
const noValidate = true;
const acceptCharset = 'UTF-8';
const action = 'shopifyapi.com';
const encType = 'text/plain';
const method = 'get';
const target = '_blank';
describe('<Form />', ... | 9,606 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/FormLayout.scss | @import '../../styles/common';
$item-min-size: 220px;
$item-horizontal-spacing: var(--p-space-300);
.Item {
flex: 1 1 auto;
&.grouped {
min-width: $item-min-size;
}
&.condensed {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
flex-basis: (0.5 * $item-min-size);
/... | 9,607 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/FormLayout.stories.tsx | import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Card, FormLayout, TextField, Text, BlockStack} from '@shopify/polaris';
export default {
component: FormLayout,
} as ComponentMeta<typeof FormLayout>;
export function Default() {
return (
<FormLayout>
<TextField labe... | 9,608 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/FormLayout.tsx | import React, {memo, Children} from 'react';
import type {NamedExoticComponent} from 'react';
import {wrapWithComponent, isElementOfType} from '../../utilities/components';
import {BlockStack} from '../BlockStack';
import {Group, Item} from './components';
export interface FormLayoutProps {
/** The content to disp... | 9,609 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/index.ts | export * from './FormLayout';
| 9,610 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/index.ts | export * from './Group';
export * from './Item';
| 9,611 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Group/Group.tsx | import React, {Children, useId} from 'react';
import {wrapWithComponent} from '../../../../utilities/components';
import {Box} from '../../../Box';
import {BlockStack} from '../../../BlockStack';
import {InlineStack} from '../../../InlineStack';
import {Text} from '../../../Text';
import {Item} from '../Item';
export... | 9,612 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Group/index.ts | export * from './Group';
| 9,613 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Group | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Group/tests/Group.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {TextField} from '../../../../TextField';
import {Group} from '../Group';
describe('<Group />', () => {
const children = (
<TextField onChange={noop} label="test" autoComplete="off" />
);
const title = 'Title';
const helpText ... | 9,614 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Item/Item.tsx | import React from 'react';
import {classNames} from '../../../../utilities/css';
import styles from '../../FormLayout.scss';
export interface ItemProps {
children?: React.ReactNode;
condensed?: boolean;
}
export function Item({children, condensed = false}: ItemProps) {
const className = classNames(
styles.... | 9,615 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Item/index.ts | export * from './Item';
| 9,616 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Item | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/components/Item/tests/Item.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import styles from '../../../FormLayout.scss';
import {TextField} from '../../../../TextField';
import {Item} from '../Item';
describe('<Item />', () => {
it('renders its children', () => {
const children = (
<TextField onChange={noo... | 9,617 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout | petrpan-code/Shopify/polaris/polaris-react/src/components/FormLayout/tests/FormLayout.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {TextField} from '../../TextField';
import {FormLayout} from '../FormLayout';
describe('<FormLayout />', () => {
it('renders its children', () => {
const children = (
<TextField onChange={noop} label="test" autoComplete="off" ... | 9,618 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/Frame.scss | @import '../../styles/common';
$sidebar-breakpoint: 1200px;
.Frame {
// stylelint-disable -- Polaris component custom properties
--pc-frame-button-size: var(--p-space-800);
--pc-sidebar-width: calc(356px + var(--p-space-400));
// stylelint-enable
width: 100%;
min-height: 100vh;
min-height: 100svh; // Fo... | 9,619 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/Frame.stories.tsx | import React, {useCallback, useRef, useState} from 'react';
import type {Args, ComponentMeta} from '@storybook/react';
import {
ActionList,
AppProvider,
LegacyCard,
ContextualSaveBar,
FormLayout,
Frame,
Layout,
Loading,
Modal,
Navigation,
Page,
SkeletonBodyText,
SkeletonDisplayText,
Skeleton... | 9,620 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/Frame.tsx | import React, {PureComponent, createRef} from 'react';
import type {MouseEvent} from 'react';
import {MobileCancelMajor} from '@shopify/polaris-icons';
import {CSSTransition} from 'react-transition-group';
import {useI18n} from '../../utilities/i18n';
import {useMediaQuery} from '../../utilities/media-query';
import {... | 9,621 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/index.ts | export * from './Frame';
export {
DEFAULT_TOAST_DURATION,
DEFAULT_TOAST_DURATION_WITH_ACTION,
} from './components';
| 9,622 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/index.ts | export * from './Toast';
export * from './ToastManager';
export * from './Loading';
export * from './ContextualSaveBar';
export * from './CSSAnimation';
| 9,623 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/CSSAnimation/CSSAnimation.scss | @import '../../../../styles/common';
.startFade {
opacity: 0;
will-change: opacity;
transition: opacity var(--p-motion-duration-300) var(--p-motion-ease-out);
pointer-events: none;
}
.endFade {
opacity: 1;
pointer-events: auto;
}
| 9,624 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/CSSAnimation/CSSAnimation.tsx | import React, {useRef, useState, useEffect} from 'react';
import {classNames, variationName} from '../../../../utilities/css';
import styles from './CSSAnimation.scss';
type AnimationType = 'fade';
export interface CSSAnimationProps {
in: boolean;
className: string;
type: AnimationType;
children?: React.Rea... | 9,625 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/CSSAnimation/index.ts | export * from './CSSAnimation';
| 9,626 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/ContextualSaveBar.scss | @import '../../../../styles/common';
.ContextualSaveBar {
/* stylelint-disable -- polaris: Used to apply dark theme to action buttons */
--p-color-bg-surface: var(--p-color-bg-inverse);
--p-color-text: var(--p-color-text-inverse);
--p-color-bg-surface-hover: var(--p-color-bg-fill-inverse-hover);
--p-color-bg... | 9,627 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/ContextualSaveBar.tsx | import React, {useCallback} from 'react';
import {RiskMajor} from '@shopify/polaris-icons';
import {Button} from '../../../Button';
import {Image} from '../../../Image';
// eslint-disable-next-line import/no-deprecated
import {LegacyStack} from '../../../LegacyStack';
import {Text} from '../../../Text';
import {Icon} ... | 9,628 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/index.ts | export * from './ContextualSaveBar';
| 9,629 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components/index.ts | export * from './DiscardConfirmationModal';
| 9,630 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components/DiscardConfirmationModal/DiscardConfirmationModal.tsx | import React from 'react';
import {useI18n} from '../../../../../../utilities/i18n';
import {Modal} from '../../../../../Modal';
export interface DiscardConfirmationModalProps {
open: boolean;
onDiscard(): void;
onCancel(): void;
}
export function DiscardConfirmationModal({
open,
onDiscard,
onCancel,
}: ... | 9,631 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components/DiscardConfirmationModal/index.ts | export * from './DiscardConfirmationModal';
| 9,632 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components/DiscardConfirmationModal | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/components/DiscardConfirmationModal/tests/DiscardConfirmationModal.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Modal} from '../../../../../../Modal';
import {DiscardConfirmationModal} from '../DiscardConfirmationModal';
describe('<DiscardConfirmationModal />', () => {
it('passes its open prop value to the Modal', () => {
const discardConfir... | 9,633 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ContextualSaveBar/tests/ContextualSaveBar.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Button} from '../../../../Button';
import {Image} from '../../../../Image';
import {ContextualSaveBar} from '../ContextualSaveBar';
import {DiscardConfirmationModal} from '../components';
describe('<ContextualSaveBar />', () => {
descr... | 9,634 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Loading/Loading.scss | @import '../../../../styles/common';
.Loading {
overflow: hidden;
height: 3px;
background-color: var(--p-color-bg-surface);
opacity: 1;
}
.Level {
width: 100%;
height: 100%;
transform-origin: 0;
background-color: var(--p-color-bg-fill-brand);
transition: transform var(--p-motion-duration-500) linear... | 9,635 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Loading/Loading.tsx | import React, {useEffect, useState} from 'react';
import {useI18n} from '../../../../utilities/i18n';
import {useIsMountedRef} from '../../../../utilities/use-is-mounted-ref';
import styles from './Loading.scss';
const STUCK_THRESHOLD = 99;
export function Loading() {
const i18n = useI18n();
const isMountedRef ... | 9,636 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Loading/index.ts | export * from './Loading';
| 9,637 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Loading | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Loading/tests/Loading.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Loading} from '../Loading';
describe('<Loading />', () => {
let requestAnimationFrameSpy: jest.SpyInstance;
beforeEach(() => {
requestAnimationFrameSpy = jest.spyOn(window, 'requestAnimationFrame');
requestAnimationFrameSpy.... | 9,638 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Toast/Toast.scss | @import '../../../../styles/common';
$Backdrop-opacity: 0.88;
.Toast {
display: inline-flex;
max-width: 500px;
padding: var(--p-space-200) var(--p-space-300);
border-radius: var(--p-border-radius-100);
background: var(--p-color-bg-inverse);
color: var(--p-color-text-inverse);
margin-bottom: var(--p-spac... | 9,639 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Toast/Toast.tsx | import React, {useEffect} from 'react';
import {AlertMinor, CancelSmallMinor} from '@shopify/polaris-icons';
import {classNames} from '../../../../utilities/css';
import {Key} from '../../../../types';
import {Button} from '../../../Button';
import {Icon} from '../../../Icon';
import {InlineStack} from '../../../Inlin... | 9,640 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Toast/index.ts | export * from './Toast';
| 9,641 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Toast | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/Toast/tests/Toast.test.tsx | import React from 'react';
import {timer} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';
import {Button} from '../../../../Button';
import {Toast} from '../Toast';
import type {ToastProps} from '../Toast';
import {Key} from '../../../../../types';
interface HandlerMap {
[eventName: st... | 9,642 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ToastManager/ToastManager.scss | @import '../../../../styles/common';
:root {
// Sass does not allow arbitrary Sass function calls in custom properties.
// They must be interpolated
// See https://github.com/sass/libsass/issues/2585
// stylelint-disable -- Polaris component custom properties
--pc-toast-manager-translate-y-out: 150px;
--pc... | 9,643 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ToastManager/ToastManager.tsx | import React, {createRef, memo} from 'react';
import {TransitionGroup, CSSTransition} from 'react-transition-group';
import {classNames} from '../../../../utilities/css';
// eslint-disable-next-line import/no-deprecated
import {EventListener} from '../../../EventListener';
import {Portal} from '../../../Portal';
impor... | 9,644 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ToastManager/index.ts | export * from './ToastManager';
| 9,645 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ToastManager | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/components/ToastManager/tests/ToastManager.test.tsx | import React from 'react';
import {timer} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';
import {Toast} from '../../Toast';
import {Frame} from '../../../Frame';
import {ToastManager} from '../ToastManager';
window.matchMedia =
window.matchMedia ||
function () {
return {
m... | 9,646 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame | petrpan-code/Shopify/polaris/polaris-react/src/components/Frame/tests/Frame.test.tsx | import React, {createRef} from 'react';
import {CSSTransition} from 'react-transition-group';
import {animationFrame, dimension} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';
import {ContextualSaveBar as PolarisContextualSavebar} from '../../ContextualSaveBar';
import {Loading as Polari... | 9,647 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar/FullscreenBar.scss | @import '../../styles/common';
.FullscreenBar {
position: relative;
display: flex;
height: $top-bar-height;
box-shadow: var(--p-shadow-100);
background-color: var(--p-color-bg-surface);
}
.BackAction {
display: flex;
flex: 0 1 auto;
align-items: center;
padding-left: var(--p-space-400);
padding-ri... | 9,648 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar/FullscreenBar.stories.tsx | import React, {useCallback, useState} from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
Badge,
Button,
ButtonGroup,
FullscreenBar,
Text,
BlockStack,
} from '@shopify/polaris';
import {useBreakpoints} from '../../utilities/breakpoints';
export default {
component: FullscreenBar,... | 9,649 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar/FullscreenBar.tsx | import React from 'react';
import {ExitMajor} from '@shopify/polaris-icons';
import {Icon} from '../Icon';
import {Text} from '../Text';
import {useI18n} from '../../utilities/i18n';
import styles from './FullscreenBar.scss';
export interface FullscreenBarProps {
/** Callback when back button is clicked */
onAct... | 9,650 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar/index.ts | export * from './FullscreenBar';
| 9,651 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar | petrpan-code/Shopify/polaris/polaris-react/src/components/FullscreenBar/tests/FullscreenBar.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {FullscreenBar} from '../FullscreenBar';
describe('<FullscreenBar />', () => {
it('renders its children', () => {
const text = 'My App Info';
const bar = mountWithApp(
<FullscreenBar onAction={() => {}}>{text}</FullscreenB... | 9,652 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/Grid.scss | @import '../../styles/common';
.Grid {
// Remap custom properties as mobile first fallbacks for grid-template-areas and grid-template-columns
// stylelint-disable -- Polaris component custom properties
--pc-grid-areas-xs: initial;
--pc-grid-areas-sm: var(--pc-grid-areas-xs);
--pc-grid-areas-md: var(--pc-grid... | 9,653 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/Grid.stories.tsx | import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {LegacyCard, Grid, Page} from '@shopify/polaris';
export default {
component: Grid,
} as ComponentMeta<typeof Grid>;
export function TwoColumn() {
return (
<Page fullWidth>
<Grid>
<Grid.Cell columnSpan={{xs: 6... | 9,654 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/Grid.tsx | import React from 'react';
import {Cell} from './components';
import styles from './Grid.scss';
type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type Areas = {
[Breakpoint in Breakpoints]?: string[];
};
type Columns = {
[Breakpoint in Breakpoints]?: number;
};
type Gap = {
[Breakpoint in Breakpoints]?: s... | 9,655 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/index.ts | export * from './Grid';
export * from './components';
| 9,656 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/index.ts | export * from './Cell';
| 9,657 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/Cell/Cell.scss | @import '../../../../styles/common';
.Cell {
// Remap custom properties as mobile first fallbacks for grid-row and grid-column
// stylelint-disable -- Polaris component custom properties
--pc-row-xs: initial;
--pc-row-sm: var(--pc-row-xs);
--pc-row-md: var(--pc-row-sm);
--pc-row-lg: var(--pc-row-md);
--p... | 9,658 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/Cell/Cell.tsx | import React from 'react';
import {classNames} from '../../../../utilities/css';
import styles from './Cell.scss';
type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type Cell = {
[Breakpoint in Breakpoints]?: string;
};
interface Columns {
/** Number of columns the section should span on extra small screens... | 9,659 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/Cell/index.ts | export * from './Cell';
| 9,660 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/Cell | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/components/Cell/tests/Cell.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Cell} from '../Cell';
describe('<Cell />', () => {
it('renders children', () => {
const children = 'children';
const cell = mountWithApp(<Cell>{children}</Cell>);
expect(cell).toContainReactComponent('div', {children});
... | 9,661 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid | petrpan-code/Shopify/polaris/polaris-react/src/components/Grid/tests/Grid.test.tsx | import React from 'react';
import {matchMedia, timer} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';
import {formatAreas, Grid} from '../Grid';
describe('<Grid />', () => {
beforeEach(() => {
matchMedia.mock();
timer.mock();
});
afterEach(() => {
matchMedia.restore();... | 9,662 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon/Icon.scss | @import '../../styles/common';
.Icon {
display: block;
height: 20px;
width: 20px;
max-height: 100%;
max-width: 100%;
margin: auto;
}
.applyColor {
color: var(--p-color-bg-surface);
}
.toneBase svg {
fill: var(--p-color-icon);
}
.toneSubdued svg {
fill: var(--p-color-icon-secondary);
}
.toneCautio... | 9,663 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon/Icon.stories.tsx | import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Icon, Text, BlockStack} from '@shopify/polaris';
import {CirclePlusMinor} from '@shopify/polaris-icons';
export default {
component: Icon,
} as ComponentMeta<typeof Icon>;
export function Default() {
return <Icon source={Circl... | 9,664 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon/Icon.tsx | import React from 'react';
import {Text} from '../Text';
import {classNames, variationName} from '../../utilities/css';
import type {IconSource} from '../../types';
import styles from './Icon.scss';
type Tone =
| 'base'
| 'subdued'
| 'caution'
| 'warning'
| 'critical'
| 'interactive'
| 'info'
| 'succ... | 9,665 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon/index.ts | export * from './Icon';
| 9,666 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon | petrpan-code/Shopify/polaris/polaris-react/src/components/Icon/tests/Icon.test.tsx | import React from 'react';
import {PlusMinor} from '@shopify/polaris-icons';
import {mountWithApp} from 'tests/utilities';
import {Icon} from '../Icon';
import {Text} from '../../Text';
describe('<Icon />', () => {
describe('accessibilityLabel', () => {
it('uses the label as the aria-label for the icon', () => ... | 9,667 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Image/Image.tsx | import React, {useCallback} from 'react';
interface SourceSet {
source: string;
descriptor?: string;
}
type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
export interface ImageProps extends React.HTMLProps<HTMLImageElement> {
alt: string;
source: string;
crossOrigin?: CrossOrigin;
sourc... | 9,668 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/Image/index.ts | export * from './Image';
| 9,669 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/Image | petrpan-code/Shopify/polaris/polaris-react/src/components/Image/tests/Image.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Image} from '../Image';
describe('<Image />', () => {
describe('img attributes', () => {
const src =
'https://cdn.shopify.com/s/assets/admin/checkout/settings-customizecart-705f57c725ac05be5a34ec20c05b94298cb8afd10aac7bd9c7ad... | 9,670 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/IndexFilters.scss | @import '../../styles/common';
$p-medium-page-up: 768px;
$spinner-size: 20px;
.IndexFiltersWrapper {
width: 100%;
}
@media #{$p-breakpoints-sm-up} {
.IndexFiltersWrapper {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
height: auto !important;
}
}
@media #{$p-breakpoints-s... | 9,671 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/IndexFilters.stories.tsx | import React, {useState, useCallback, useEffect} from 'react';
import type {ComponentMeta} from '@storybook/react';
import type {TabProps} from '@shopify/polaris';
import {
ChoiceList,
Text,
useIndexResourceState,
IndexTable,
IndexFilters,
RangeSlider,
TextField,
Card,
Button,
useSetIndexFiltersMode... | 9,672 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/IndexFilters.tsx | import React, {useMemo, useCallback, useRef} from 'react';
import {Transition} from 'react-transition-group';
import {useI18n} from '../../utilities/i18n';
import {classNames} from '../../utilities/css';
import {useEventListener} from '../../utilities/use-event-listener';
import {useToggle} from '../../utilities/use-t... | 9,673 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/constants.ts | export const SEPARATOR = ',';
export const ALL_SEARCH_ID = 'All_SEARCH';
export const CUSTOM_SEARCH_ID = 'CUSTOM_SEARCH';
export const SEARCH_DEBOUNCE_INTERVAL = 250;
| 9,674 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/index.ts | export {IndexFilters} from './IndexFilters';
export {SortButton} from './components/SortButton/SortButton';
export type {IndexFiltersProps} from './IndexFilters';
export * from './hooks';
export * from './types';
| 9,675 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/types.ts | type SortValue = `${string} ${'asc' | 'desc'}`;
export interface SortButtonChoice {
label: string;
disabled?: boolean;
value: SortValue;
directionLabel: string;
}
export interface IndexFiltersPrimaryAction {
type: 'save' | 'save-as' | 'cancel';
onAction: (name: string) => Promise<boolean>;
disabled?: bo... | 9,676 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/index.ts | export {Container} from './Container';
export {SearchFilterButton} from './SearchFilterButton';
export {SortButton} from './SortButton';
export {UpdateButtons} from './UpdateButtons';
export {EditColumnsButton} from './EditColumnsButton';
| 9,677 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/Container/Container.scss | @import '../../../../styles/common';
.Container {
border-bottom: var(--p-border-width-025) solid var(--p-color-border);
border-top-left-radius: var(--p-border-radius-200);
border-top-right-radius: var(--p-border-radius-200);
background: var(--p-color-bg-surface);
}
@media #{$p-breakpoints-sm-down} {
.Contai... | 9,678 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/Container/Container.tsx | import React from 'react';
import type {ReactNode} from 'react';
import styles from './Container.scss';
export interface ContainerProps {
children: ReactNode;
}
export const Container = ({children}: ContainerProps) => {
return <div className={styles.Container}>{children}</div>;
};
| 9,679 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/Container/index.ts | export {Container} from './Container';
export type {ContainerProps} from './Container';
| 9,680 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/EditColumnsButton/EditColumnsButton.tsx | import React from 'react';
import {Columns3Minor} from '@shopify/polaris-icons';
import {useI18n} from '../../../../utilities/i18n';
import {Button} from '../../../Button';
import {Tooltip} from '../../../Tooltip';
import {Text} from '../../../Text';
export interface EditColumnsButtonProps {
onClick: () => void;
... | 9,681 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/EditColumnsButton/index.ts | export {EditColumnsButton} from './EditColumnsButton';
| 9,682 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SearchFilterButton/SearchFilterButton.tsx | import React from 'react';
import type {CSSProperties} from 'react';
import {SearchMinor, FilterMinor} from '@shopify/polaris-icons';
import {Icon} from '../../../Icon';
import {Tooltip} from '../../../Tooltip';
import {Text} from '../../../Text';
import {InlineStack} from '../../../InlineStack';
import {Button} from ... | 9,683 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SearchFilterButton/index.ts | export {SearchFilterButton} from './SearchFilterButton';
| 9,684 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/SortButton.tsx | import React, {useState, useMemo} from 'react';
import {SortMinor} from '@shopify/polaris-icons';
import {useI18n} from '../../../../utilities/i18n';
import {Popover} from '../../../Popover';
import {ChoiceList} from '../../../ChoiceList';
import type {ChoiceListProps} from '../../../ChoiceList';
import {Tooltip} from... | 9,685 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/index.ts | export {SortButton} from './SortButton';
| 9,686 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/index.ts | export {DirectionButton} from './DirectionButton';
| 9,687 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.scss | @import '../../../../../../styles/common';
.DirectionButton {
// stylelint-disable-next-line -- This mixin cannot be replaced with a single token
@include focus-ring($size: 'wide');
border-radius: var(--p-border-radius-200);
padding: var(--p-space-100) var(--p-space-300) var(--p-space-100)
var(--p-space-20... | 9,688 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.tsx | import React from 'react';
import type {ReactNode} from 'react';
import {ArrowDownMinor, ArrowUpMinor} from '@shopify/polaris-icons';
import {classNames} from '../../../../../../utilities/css';
import {UnstyledButton} from '../../../../../UnstyledButton';
import {Icon} from '../../../../../Icon';
import styles from '... | 9,689 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/index.ts | export {DirectionButton} from './DirectionButton';
| 9,690 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/tests/DirectionButton.test.tsx | import React from 'react';
import {ArrowUpMinor, ArrowDownMinor} from '@shopify/polaris-icons';
import {mountWithApp} from 'tests/utilities';
import {UnstyledButton} from '../../../../../../UnstyledButton';
import {Icon} from '../../../../../../Icon';
import {DirectionButton} from '..';
import type {DirectionButtonPro... | 9,691 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/SortButton/tests/SortButton.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {ChoiceList} from '../../../../ChoiceList';
import {Popover} from '../../../../Popover';
import {UnstyledButton} from '../../../../UnstyledButton';
import type {SortButtonChoice} from '../../../types';
import {SortButton} from '..';
import... | 9,692 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/UpdateButtons/UpdateButtons.tsx | import React, {useState, useEffect, useMemo, useRef} from 'react';
import {useI18n} from '../../../../utilities/i18n';
import {Modal} from '../../../Modal';
import {TextField} from '../../../TextField';
import {Form} from '../../../Form';
import {FormLayout} from '../../../FormLayout';
import {InlineStack} from '../..... | 9,693 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/UpdateButtons/index.ts | export * from './UpdateButtons';
| 9,694 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/UpdateButtons | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/components/UpdateButtons/tests/UpdateButtons.test.tsx | import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {Modal} from '../../../../Modal';
import {TextField} from '../../../../TextField';
import {Button} from '../../../../Button';
import {UpdateButtons} from '..';
import type {UpdateButtonsProps} from '..';
describe('UpdateButtons', () => {
... | 9,695 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks/index.ts | export * from './useSetIndexFiltersMode';
export * from './useIsSticky';
| 9,696 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks/useIsSticky/index.ts | export * from './useIsSticky';
| 9,697 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks/useIsSticky/useIsSticky.ts | import {useEffect, useRef, useState} from 'react';
import type {RefObject} from 'react';
import {debounce} from '../../../../utilities/debounce';
import type {IndexFiltersMode} from '../../types';
const DEBOUNCE_PERIOD = 250;
export function useIsSticky(
mode: IndexFiltersMode,
disabled: boolean,
isFlushWhenSt... | 9,698 |
0 | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks/useIsSticky | petrpan-code/Shopify/polaris/polaris-react/src/components/IndexFilters/hooks/useIsSticky/tests/useIsSticky.test.tsx | import React from 'react';
import {intersectionObserver} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';
import {IndexFiltersMode} from '../../../types';
import {useIsSticky} from '..';
interface Props {
disabled?: boolean;
}
function Component({disabled}: Props) {
const {intersecti... | 9,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.