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/gitify-app/gitify/src/components | petrpan-code/gitify-app/gitify/src/components/__snapshots__/Sidebar.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/Sidebar.tsx should render itself & its children (logged in) 1`] = `
<div
className="flex flex-col fixed left-14 w-14 -ml-14 h-full bg-gray-sidebar overflow-y-auto "
>
<div
className="flex flex-col flex-1 items-center py-4"
>
<svg
classN... | 2,400 |
0 | petrpan-code/gitify-app/gitify/src/components | petrpan-code/gitify-app/gitify/src/components/fields/Checkbox.tsx | import * as React from 'react';
interface IFieldCheckbox {
name: string;
label: string;
checked: boolean;
onChange: any;
placeholder?: string;
}
export const FieldCheckbox = (props: IFieldCheckbox) => {
return (
<div className="flex items-start mt-1 mb-3">
<div className="flex items-center h-5">... | 2,401 |
0 | petrpan-code/gitify-app/gitify/src/components | petrpan-code/gitify-app/gitify/src/components/fields/FieldInput.tsx | import React from 'react';
import { Field } from 'react-final-form';
export interface IProps {
name: string;
type?: string;
label: string;
placeholder?: string;
helpText?: React.ReactNode | string;
required?: boolean;
}
export const FieldInput: React.FC<IProps> = ({
label,
name,
placeholder = '',
... | 2,402 |
0 | petrpan-code/gitify-app/gitify/src/components | petrpan-code/gitify-app/gitify/src/components/fields/RadioGroup.test.tsx | import * as React from 'react';
import * as TestRendener from 'react-test-renderer';
import { fireEvent, render } from '@testing-library/react';
import { FieldRadioGroup } from './RadioGroup';
describe('components/fields/radiogroup.tsx', () => {
const props = {
label: 'Appearance',
name: 'appearance',
p... | 2,403 |
0 | petrpan-code/gitify-app/gitify/src/components | petrpan-code/gitify-app/gitify/src/components/fields/RadioGroup.tsx | import * as React from 'react';
import { RadioGroupItem } from '../../types';
export const FieldRadioGroup = ({
label,
placeholder,
name,
options,
onChange,
value,
}: {
name: string;
label: string;
placeholder?: string;
options: RadioGroupItem[];
onChange: (event: React.ChangeEvent<HTMLInputEleme... | 2,404 |
0 | petrpan-code/gitify-app/gitify/src/components/fields | petrpan-code/gitify-app/gitify/src/components/fields/__snapshots__/RadioGroup.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/fields/radiogroup.tsx should render 1`] = `
<fieldset
className="mb-1"
id="appearance"
>
<div>
<legend
className="mb-1 text-base font-medium dark:text-white"
>
Appearance
</legend>
<p
className="text-sm text-gray-50... | 2,405 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/context/App.test.tsx | import React, { useContext } from 'react';
import { act, fireEvent, render, waitFor } from '@testing-library/react';
import { AppContext, AppProvider } from './App';
import { AuthState, SettingsState } from '../types';
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
import { useNotifications } fr... | 2,406 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/context/App.tsx | import React, {
useState,
createContext,
useCallback,
useEffect,
useMemo,
} from 'react';
import {
AccountNotifications,
Appearance,
AuthOptions,
AuthState,
AuthTokenOptions,
SettingsState,
} from '../types';
import { apiRequestAuth } from '../utils/api-requests';
import { addAccount, authGitHub,... | 2,407 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/hooks/useInterval.ts | import { useEffect, useRef } from 'react';
// Thanks to https://overreacted.io/making-setinterval-declarative-with-react-hooks/
export const useInterval = (callback, delay) => {
const savedCallback = useRef();
// Remember the latest callback.
useEffect(() => {
savedCallback.current = callback;
}, [callba... | 2,408 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/hooks/useNotifications.test.ts | import axios from 'axios';
import nock from 'nock';
import { act, renderHook } from '@testing-library/react-hooks';
import { mockAccounts, mockSettings } from '../__mocks__/mock-state';
import { useNotifications } from './useNotifications';
import { AuthState } from '../types';
import { mockedUser } from '../__mocks__... | 2,409 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/hooks/useNotifications.ts | import axios from 'axios';
import { parse } from 'url';
import { useCallback, useState } from 'react';
import { AccountNotifications, AuthState, SettingsState } from '../types';
import { Notification } from '../typesGithub';
import { apiRequestAuth } from '../utils/api-requests';
import {
getEnterpriseAccountToken,
... | 2,410 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/icons/AddAccount.tsx | import * as React from 'react';
export const IconAddAccount = ({ className = '' }: { className?: string }) => {
return (
<svg
aria-hidden="true"
className={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"
role="img"
aria-labelledby="iconAddAccountId"
>
... | 2,411 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/icons/Cog.tsx | import * as React from 'react';
export const IconCog = ({ className = '' }: { className?: string }) => {
return (
<svg
aria-hidden="true"
className={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
>
<g className="prefix__fa-group">
<path
cla... | 2,412 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/icons/Logout.tsx | import * as React from 'react';
export const IconLogOut = ({ className = '' }: { className?: string }) => {
return (
<svg
aria-hidden="true"
className={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
role="img"
aria-labelledby="iconLogoutId"
>
<ti... | 2,413 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/icons/Quit.tsx | import * as React from 'react';
export const IconQuit = ({ className = '' }: { className?: string }) => {
return (
<svg
aria-hidden="true"
className={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
role="img"
aria-labelledby="iconQuitId"
>
<title ... | 2,414 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/icons/Refresh.tsx | import * as React from 'react';
export const IconRefresh = ({ className = '' }: { className?: string }) => {
return (
<svg
aria-hidden="true"
className={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
>
<g className="prefix__fa-group">
<path
... | 2,415 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Login.test.tsx | import React from 'react';
import TestRenderer from 'react-test-renderer';
import { MemoryRouter } from 'react-router-dom';
import { render, fireEvent } from '@testing-library/react';
const { ipcRenderer } = require('electron');
import { AppContext } from '../context/App';
import { LoginRoute } from './Login';
const... | 2,416 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Login.tsx | const { ipcRenderer } = require('electron');
import React, { useCallback, useContext, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { AppContext } from '../context/App';
import { Logo } from '../components/Logo';
export const LoginRoute: React.FC = () => {
const navigate = useNav... | 2,417 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/LoginEnterprise.test.tsx | import * as React from 'react';
import * as TestRenderer from 'react-test-renderer';
import { fireEvent, render } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
const { ipcRenderer } = require('electron');
import { AppContext } from '../context/App';
import { AuthState } from '../type... | 2,418 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/LoginEnterprise.tsx | const ipcRenderer = require('electron').ipcRenderer;
import React, { useCallback, useContext, useEffect } from 'react';
import { Form, FormRenderProps } from 'react-final-form';
import { ArrowLeftIcon } from '@primer/octicons-react';
import { useNavigate } from 'react-router-dom';
import { AppContext } from '../conte... | 2,419 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/LoginWithToken.test.tsx | import React from 'react';
import TestRenderer from 'react-test-renderer';
import { act, fireEvent, render, waitFor } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { shell } from 'electron';
import { AppContext } from '../context/App';
import { LoginWithToken, validate } from '... | 2,420 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/LoginWithToken.tsx | import React, { useCallback, useContext, useState } from 'react';
import { Form, FormRenderProps } from 'react-final-form';
import { ArrowLeftIcon } from '@primer/octicons-react';
import { useNavigate } from 'react-router-dom';
import { shell } from 'electron';
import { AppContext } from '../context/App';
import { Aut... | 2,421 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Notifications.test.tsx | import React from 'react';
import TestRenderer from 'react-test-renderer';
import { AppContext } from '../context/App';
import { mockedAccountNotifications } from '../__mocks__/mockedData';
import { NotificationsRoute } from './Notifications';
jest.mock('../components/AccountNotifications', () => ({
AccountNotifica... | 2,422 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Notifications.tsx | import React, { useContext, useMemo } from 'react';
import { AccountNotifications } from '../components/AccountNotifications';
import { AllRead } from '../components/AllRead';
import { AppContext } from '../context/App';
import { Oops } from '../components/Oops';
export const NotificationsRoute: React.FC = (props) =>... | 2,423 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Settings.test.tsx | import React from 'react';
import TestRenderer, { act } from 'react-test-renderer';
import { render, fireEvent } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
const { ipcRenderer } = require('electron');
import { SettingsRoute } from './Settings';
import { AppContext } from '../conte... | 2,424 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/routes/Settings.tsx | import React, { useCallback, useContext, useState, useEffect } from 'react';
import { ipcRenderer } from 'electron';
import { useNavigate } from 'react-router-dom';
import { ArrowLeftIcon } from '@primer/octicons-react';
import { AppContext } from '../context/App';
import { Appearance } from '../types';
import { Field... | 2,425 |
0 | petrpan-code/gitify-app/gitify/src/routes | petrpan-code/gitify-app/gitify/src/routes/__snapshots__/Login.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`routes/Login.tsx should render itself & its children 1`] = `
<div
className="flex flex-1 flex-col justify-center items-center p-4 bg-white dark:bg-gray-dark dark:text-white"
>
<svg
className="w-16 h-16"
onClick={[Function]}
role="logo"
viewBox="0 ... | 2,426 |
0 | petrpan-code/gitify-app/gitify/src/routes | petrpan-code/gitify-app/gitify/src/routes/__snapshots__/LoginEnterprise.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`routes/LoginEnterprise.js renders correctly 1`] = `
<div
className="flex-1 bg-white dark:bg-gray-dark dark:text-white"
>
<div
className="flex justify-between items-center mt-4 py-2 mx-8"
>
<button
aria-label="Go Back"
className="focus:outlin... | 2,427 |
0 | petrpan-code/gitify-app/gitify/src/routes | petrpan-code/gitify-app/gitify/src/routes/__snapshots__/LoginWithToken.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`routes/LoginWithToken.js renders correctly 1`] = `
<div
className="flex-1 bg-white dark:bg-gray-dark dark:text-white"
>
<div
className="flex justify-between items-center mt-4 py-2 mx-8"
>
<button
aria-label="Go Back"
className="focus:outline... | 2,428 |
0 | petrpan-code/gitify-app/gitify/src/routes | petrpan-code/gitify-app/gitify/src/routes/__snapshots__/Notifications.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`routes/Notifications.ts should render itself & its children (all read notifications) 1`] = `<AllRead />`;
exports[`routes/Notifications.ts should render itself & its children (error page - oops) 1`] = `<Oops />`;
exports[`routes/Notifications.ts should render itsel... | 2,429 |
0 | petrpan-code/gitify-app/gitify/src/routes | petrpan-code/gitify-app/gitify/src/routes/__snapshots__/Settings.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`routes/Settings.tsx should render itself & its children 1`] = `
<div
className="flex flex-1 flex-col dark:bg-gray-dark dark:text-white"
>
<div
className="flex justify-between items-center mt-4 py-2 mx-8"
>
<button
aria-label="Go Back"
classN... | 2,430 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/api-requests.ts | import axios, { AxiosPromise, Method } from 'axios';
export function apiRequest(
url: string,
method: Method,
data = {},
): AxiosPromise {
axios.defaults.headers.common['Accept'] = 'application/json';
axios.defaults.headers.common['Content-Type'] = 'application/json';
axios.defaults.headers.common['Cache-C... | 2,431 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/appearance.test.ts | import { Appearance } from '../types';
import { setAppearance } from './appearance';
import * as appearanceHelpers from './appearance';
describe('utils/appearance.tsx', () => {
beforeAll(() => {
jest.spyOn(appearanceHelpers, 'setLightMode');
jest.spyOn(appearanceHelpers, 'setDarkMode');
});
beforeEach(... | 2,432 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/appearance.ts | import { Appearance } from '../types';
export const setLightMode = () =>
document.querySelector('html').classList.remove('dark');
export const setDarkMode = () =>
document.querySelector('html').classList.add('dark');
export const setAppearance = (mode?: Appearance) => {
switch (mode) {
case Appearance.LIGH... | 2,433 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/auth.test.ts | import { AxiosPromise, AxiosResponse } from 'axios';
import remote from '@electron/remote';
const browserWindow = new remote.BrowserWindow();
import * as auth from './auth';
import * as apiRequests from './api-requests';
import { AuthState } from '../types';
describe('utils/auth.tsx', () => {
describe('authGitHub'... | 2,434 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/auth.ts | import { BrowserWindow } from '@electron/remote';
import { generateGitHubAPIUrl } from './helpers';
import { apiRequest, apiRequestAuth } from '../utils/api-requests';
import { AuthResponse, AuthState, AuthTokenResponse } from '../types';
import { Constants } from '../utils/constants';
import { User } from '../typesGi... | 2,435 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/comms.test.ts | import { ipcRenderer, shell } from 'electron';
import {
updateTrayIcon,
openExternalLink,
setAutoLaunch,
restoreSetting,
} from './comms';
describe('utils/comms.ts', () => {
beforeEach(function () {
jest.spyOn(ipcRenderer, 'send');
});
afterEach(() => {
jest.clearAllMocks();
});
it('should ... | 2,436 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/comms.ts | import { ipcRenderer, shell } from 'electron';
export function openExternalLink(url: string): void {
shell.openExternal(url);
}
export function setAutoLaunch(value: boolean): void {
ipcRenderer.send('set-login-item-settings', {
openAtLogin: value,
openAsHidden: value,
});
}
export function updateTrayIc... | 2,437 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/constants.ts | export const Constants = {
// GitHub OAuth
AUTH_SCOPE: ['read:user', 'notifications', 'repo'],
DEFAULT_AUTH_OPTIONS: {
hostname: 'github.com',
clientId: process.env.OAUTH_CLIENT_ID,
clientSecret: process.env.OAUTH_CLIENT_SECRET,
},
REPO_SLUG: 'gitify-app/gitify',
// Storage
STORAGE_KEY: 'gi... | 2,438 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/github-api.test.ts | import { formatReason, getNotificationTypeIcon } from './github-api';
import { Reason, SubjectType } from '../typesGithub';
describe('./utils/github-api.ts', () => {
it('should format the notification reason', () => {
expect(formatReason('assign')).toMatchSnapshot();
expect(formatReason('author')).toMatchSna... | 2,439 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/github-api.ts | import {
AlertIcon,
CommentDiscussionIcon,
GitCommitIcon,
GitPullRequestIcon,
IssueOpenedIcon,
MailIcon,
OcticonProps,
QuestionIcon,
SyncIcon,
TagIcon,
} from '@primer/octicons-react';
import { Reason, StateType, SubjectType } from '../typesGithub';
// prettier-ignore
const DESCRIPTIONS = {
ASS... | 2,440 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/helpers.test.ts | import {
generateGitHubWebUrl,
generateGitHubAPIUrl,
generateNotificationReferrerId,
getCommentId,
getLatestDiscussionCommentId,
} from './helpers';
import {
mockedSingleNotification,
mockedUser,
mockedGraphQLResponse,
} from '../__mocks__/mockedData';
const URL = {
normal: {
api: 'https://api.gi... | 2,441 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/helpers.ts | import { EnterpriseAccount, AuthState } from '../types';
import {
Notification,
GraphQLSearch,
DiscussionCommentEdge,
} from '../typesGithub';
import { apiRequestAuth } from '../utils/api-requests';
import { openExternalLink } from '../utils/comms';
import { Constants } from './constants';
export function getEnt... | 2,442 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/notifications.test.ts | import { ipcRenderer } from 'electron';
import { generateGitHubWebUrl, getCommentId } from './helpers';
import {
mockedAccountNotifications,
mockedGithubNotifications,
mockedSingleAccountNotifications,
mockedUser,
} from '../__mocks__/mockedData';
import { mockAccounts } from '../__mocks__/mock-state';
import ... | 2,443 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/notifications.ts | import { ipcRenderer } from 'electron';
import { openInBrowser } from '../utils/helpers';
import { updateTrayIcon } from './comms';
import { Notification } from '../typesGithub';
import { AccountNotifications, SettingsState, AuthState } from '../types';
export const setTrayIconColor = (notifications: AccountNotificat... | 2,444 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/remove-notification.test.ts | import {
mockedSingleAccountNotifications,
mockedSingleNotification,
} from '../__mocks__/mockedData';
import { removeNotification } from './remove-notification';
describe('utils/remove-notification.ts', () => {
const notificationId = mockedSingleNotification.id;
const hostname = mockedSingleAccountNotificatio... | 2,445 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/remove-notification.ts | import { AccountNotifications } from '../types';
export const removeNotification = (
id: string,
notifications: AccountNotifications[],
hostname: string,
): AccountNotifications[] => {
const accountIndex = notifications.findIndex(
(accountNotifications) => accountNotifications.hostname === hostname,
);
... | 2,446 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/remove-notifications.test.ts | import {
mockedAccountNotifications,
mockedSingleAccountNotifications,
mockedSingleNotification,
} from '../__mocks__/mockedData';
import { removeNotifications } from './remove-notifications';
describe('utils/remove-notification.ts', () => {
const repoSlug = mockedSingleNotification.repository.full_name;
con... | 2,447 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/remove-notifications.ts | import { AccountNotifications } from '../types';
export const removeNotifications = (
repoSlug: string,
notifications: AccountNotifications[],
hostname: string,
): AccountNotifications[] => {
const accountIndex = notifications.findIndex(
(accountNotifications) => accountNotifications.hostname === hostname,... | 2,448 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/storage.test.ts | import { mockSettings } from '../__mocks__/mock-state';
import { clearState, loadState, saveState } from './storage';
describe('utils/storage.ts', () => {
it('should load the state from localstorage - existing', () => {
jest.spyOn(localStorage.__proto__, 'getItem').mockReturnValueOnce(
JSON.stringify({
... | 2,449 |
0 | petrpan-code/gitify-app/gitify/src | petrpan-code/gitify-app/gitify/src/utils/storage.ts | import { AuthState, SettingsState } from '../types';
import { Constants } from './constants';
export const loadState = (): {
accounts?: AuthState;
settings?: SettingsState;
} => {
const existing = localStorage.getItem(Constants.STORAGE_KEY);
const { auth: accounts, settings } = (existing && JSON.parse(existing... | 2,450 |
0 | petrpan-code/gitify-app/gitify/src/utils | petrpan-code/gitify-app/gitify/src/utils/__snapshots__/github-api.test.ts.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`./utils/github-api.ts should format the notification reason 1`] = `
{
"description": "You were assigned to the issue.",
"type": "Assign",
}
`;
exports[`./utils/github-api.ts should format the notification reason 2`] = `
{
"description": "You created the thread... | 2,451 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.codecov.yml | codecov:
require_ci_to_pass: yes
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
branches:
- "master"
| 2,452 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.eslintignore | .now/*
.next/*
examples/*
dist/*
esm/*
public/*
scripts/*
tests/*
*.config.js
| 2,453 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.eslintrc.js | module.exports = {
parser: '@typescript-eslint/parser',
extends: ['eslint-config-ts-lambdas', 'eslint-config-ts-lambdas/react', 'prettier'],
plugins: ['@typescript-eslint'],
settings: {
react: {
pragma: 'React',
version: 'detect',
},
},
parserOptions: {
project: './tsconfig.json',
... | 2,454 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.jest.config.js | module.exports = {
verbose: true,
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['./tests/setup.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
testPathIgnorePatterns: ['/pages/', '/dist/', '/lib/', '/esm/'],
transform: {
'^.+\\.tsx?$': ['babel-jest', { configFile: './tests/.babelrc.js' }],... | 2,455 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.prettierignore | .github
.next
.now
.circleci
dist
coverage
public
esm
*.json
*.d.ts
*.yml
*.snap
| 2,456 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.travis.yml | language: node_js
node_js:
- 13.9.0
cache:
directories:
- "node_modules"
notifications:
email:
on_success: never
branches:
only:
- master
install:
- yarn
script:
- yarn run build
| 2,457 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/.vercelignore | .hg
.git
.gitmodules
.svn
.cache
.next
.now
.vercel
.npmignore
.dockerignore
.gitignore
.*.swp
.DS_Store
.wafpicke-*
.lock-wscript
.env.local
.env.*.local
.venv
npm-debug.log
config.gypi
node_modules
__pycache__
venv
CVS
examples
esm
dist
coverage
.circleci
| 2,458 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/LICENSE | MIT License
Copyright (c) 2020 Geist UI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... | 2,459 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/README.md | <p align="center" height="370">
<img align="center" height="370" src="https://user-images.githubusercontent.com/11304944/91128466-dfc96c00-e6da-11ea-8b03-a96e6b98667d.png">
</p>
<p align="center">
<img alt="Codecov" src="https://img.shields.io/codecov/c/github/geist-org/geist-ui?style=for-the-badge&labelColor=000000">... | 2,460 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| 2,461 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/next.config.js | const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)?$/,
options: {
rehypePlugins: [require('@mapbox/rehype-prism'), require('rehype-join-line')],
},
})
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const nextConfig = {
generateEtags: ... | 2,462 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/now.json | {
"github": {
"silent": true
}
}
| 2,463 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/package.json | {
"name": "@geist-ui/core",
"version": "2.3.8",
"main": "dist/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
"unpkg": "dist/index.min.js",
"scripts": {
"dev": "yarn docs:collect && next dev",
"docs:start": "next start",
"docs:collect": "node scripts/collect-meta.js",
"docs... | 2,464 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/tsconfig.json | {
"compilerOptions": {
"baseUrl": ".",
"paths": {
"geist-ui": [
"components/index.tsx"
]
},
"strictNullChecks": true,
"moduleResolution": "node",
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "preserve",
"noUnusedParameters": true,
"noUnuse... | 2,465 |
0 | petrpan-code/geist-org | petrpan-code/geist-org/geist-ui/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/cli@^7.14.5":
version "7.16.8"
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.8.tgz#44b9be7706762bfa3bff8adbf746da336eb0ab7c"
integrity sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZB... | 2,466 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/.circleci/config.yml | version: 2
jobs:
test:
docker:
- image: circleci/node:14.15.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- run: yarn
- save_cache:
paths... | 2,467 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/components/index.ts | // @ts-ignore
/// <reference types="styled-jsx" />
export { default as AutoComplete } from './auto-complete'
export type { AutoCompleteProps } from './auto-complete'
export { default as Avatar } from './avatar'
export type { AvatarProps, AvatarGroupProps } from './avatar'
export { default as Badge } from './badge'
e... | 2,468 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete-context.ts | import React, { MutableRefObject } from 'react'
export interface AutoCompleteConfig {
value?: string
updateValue?: (val: string) => unknown
visible?: boolean
updateVisible?: (next: boolean) => unknown
ref?: MutableRefObject<HTMLElement | null>
}
const defaultContext = {
visible: false,
}
export const Aut... | 2,469 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete-dropdown.tsx | import React, { CSSProperties, useMemo } from 'react'
import useTheme from '../use-theme'
import { useAutoCompleteContext } from './auto-complete-context'
import Dropdown from '../shared/dropdown'
import useClasses from '../use-classes'
interface Props {
visible: boolean
className?: string
disableMatchWidth?: bo... | 2,470 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete-empty.tsx | import React from 'react'
import AutoCompleteSearch from './auto-complete-searching'
interface Props {
hidden?: boolean
className?: string
}
const defaultProps = {
hidden: false,
className: '',
}
export type AutoCompleteEmptyProps = Props & React.HTMLAttributes<any>
const AutoCompleteEmpty: React.FC<React.P... | 2,471 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete-item.tsx | import React, { useMemo } from 'react'
import useTheme from '../use-theme'
import { useAutoCompleteContext } from './auto-complete-context'
import Ellipsis from '../shared/ellipsis'
import useScale, { withScale } from '../use-scale'
import useClasses from '../use-classes'
interface Props {
value: string
// The 'is... | 2,472 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete-searching.tsx | import React from 'react'
import useTheme from '../use-theme'
import useScale, { withScale } from '../use-scale'
interface Props {
className?: string
}
const defaultProps = {
className: '',
}
export type AutoCompleteSearchProps = Props & React.HTMLAttributes<any>
const AutoCompleteSearchComponent: React.FC<
R... | 2,473 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/auto-complete.tsx | import React, {
CSSProperties,
useEffect,
useImperativeHandle,
useMemo,
useRef,
useState,
} from 'react'
import Input from '../input'
import AutoCompleteItem, { AutoCompleteItemProps } from './auto-complete-item'
import AutoCompleteDropdown from './auto-complete-dropdown'
import AutoCompleteSearching from '... | 2,474 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/auto-complete/index.ts | import AutoComplete from './auto-complete'
import AutoCompleteItem from './auto-complete-item'
import AutoCompleteSearching from './auto-complete-searching'
import AutoCompleteEmpty from './auto-complete-empty'
export type AutoCompleteComponentType = typeof AutoComplete & {
Item: typeof AutoCompleteItem
Option: ty... | 2,475 |
0 | petrpan-code/geist-org/geist-ui/components/auto-complete | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { AutoComplete } from 'components'
import { nativeEvent } from 'tests/utils'
import { act } from 'react-dom/test-utils'
describe('AutoComplete', () => {
it('should render correctly', () => {
const wrapper = mount(<AutoComplete />)
expect(() => w... | 2,476 |
0 | petrpan-code/geist-org/geist-ui/components/auto-complete | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__/search.test.tsx | import React from 'react'
import { mount, render } from 'enzyme'
import { AutoComplete } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { act } from 'react-dom/test-utils'
const mockOptions = [{ label: 'London', value: 'london' }]
describe('AutoComplete Search', () => {
it('should ... | 2,477 |
0 | petrpan-code/geist-org/geist-ui/components/auto-complete | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__/use-input.test.tsx | import React, { useEffect } from 'react'
import { mount } from 'enzyme'
import { AutoComplete, useInput } from 'components'
describe('UseInput', () => {
it('should follow change with use-input', () => {
let log = ''
const logSpy = jest.spyOn(console, 'log').mockImplementation(msg => (log = msg))
const Mo... | 2,478 |
0 | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__ | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AutoComplete should render correctly 1`] = `<ScaleGeistAutoComplete />`;
| 2,479 |
0 | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__ | petrpan-code/geist-org/geist-ui/components/auto-complete/__tests__/__snapshots__/search.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AutoComplete Search should hide empty component 1`] = `
LoadedCheerio {
"0": Node {
"attribs": Object {
"class": "auto-complete",
},
"children": Array [
Node {
"attribs": Object {
"class": "with-label",
},
"... | 2,480 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/avatar/avatar-group.tsx | import React from 'react'
import useTheme from '../use-theme'
import useScale, { withScale } from '../use-scale'
import useClasses from '../use-classes'
interface Props {
count?: number
className?: string
}
const defaultProps = {
className: '',
}
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
... | 2,481 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/avatar/avatar.tsx | import React from 'react'
import useTheme from '../use-theme'
import useScale, { withScale } from '../use-scale'
import useClasses from '../use-classes'
interface Props {
src?: string
stacked?: boolean
text?: string
isSquare?: boolean
className?: string
}
const defaultProps = {
stacked: false,
text: '',... | 2,482 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/avatar/index.ts | import Avatar from './avatar'
import AvatarGroup from './avatar-group'
export type AvatarComponentType = typeof Avatar & {
Group: typeof AvatarGroup
}
;(Avatar as AvatarComponentType).Group = AvatarGroup
export type { AvatarProps } from './avatar'
export type { AvatarGroupProps } from './avatar-group'
export defau... | 2,483 |
0 | petrpan-code/geist-org/geist-ui/components/avatar | petrpan-code/geist-org/geist-ui/components/avatar/__tests__/index.test.tsx | import React from 'react'
import { mount, render, shallow } from 'enzyme'
import { Avatar } from 'components'
describe('Avatar', () => {
it('should support square and circle', () => {
const circle = shallow(<Avatar />)
expect(() => circle.unmount()).not.toThrow()
const square = shallow(<Avatar isSquare /... | 2,484 |
0 | petrpan-code/geist-org/geist-ui/components/avatar/__tests__ | petrpan-code/geist-org/geist-ui/components/avatar/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Avatar should render text element 1`] = `
LoadedCheerio {
"0": Node {
"attribs": Object {
"class": "avatar",
},
"children": Array [
Node {
"attribs": Object {
"class": "avatar-text",
},
"children": Array [],... | 2,485 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/badge/badge-anchor.tsx | import React, { useMemo } from 'react'
import { pickChild } from '../utils/collections'
import { tuple } from '../utils/prop-types'
import Badge from './badge'
const placement = tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight')
export type BadgeAnchorPlacement = typeof placement[number]
interface Props {
p... | 2,486 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/badge/badge.tsx | import React, { useMemo } from 'react'
import useTheme from '../use-theme'
import { NormalTypes } from '../utils/prop-types'
import { GeistUIThemesPalette } from '../themes/presets'
import useScale, { withScale } from '../use-scale'
import useClasses from '../use-classes'
export type BadgeTypes = NormalTypes
interfac... | 2,487 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/badge/index.ts | import Badge from './badge'
import BadgeAnchor from './badge-anchor'
export type BadgeComponentType = typeof Badge & {
Anchor: typeof BadgeAnchor
}
;(Badge as BadgeComponentType).Anchor = BadgeAnchor
export type { BadgeProps, BadgeTypes } from './badge'
export type { BadgeAnchorProps, BadgeAnchorPlacement } from '.... | 2,488 |
0 | petrpan-code/geist-org/geist-ui/components/badge | petrpan-code/geist-org/geist-ui/components/badge/__tests__/anchor.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Badge } from 'components'
describe('BadgeAnchor', () => {
it('should render correctly', () => {
const wrapper = mount(
<Badge.Anchor>
<Badge>test</Badge>
<a>link</a>
</Badge.Anchor>,
)
expect(() => wrapper.unmou... | 2,489 |
0 | petrpan-code/geist-org/geist-ui/components/badge | petrpan-code/geist-org/geist-ui/components/badge/__tests__/index.test.tsx | import React from 'react'
import { mount, render, shallow } from 'enzyme'
import Badge from '../badge'
describe('Badge', () => {
it('should supoort text', () => {
const html = render(<Badge>count</Badge>)
expect(html).toMatchSnapshot()
const badge = mount(<Badge>count</Badge>)
expect(() => badge.unmo... | 2,490 |
0 | petrpan-code/geist-org/geist-ui/components/badge/__tests__ | petrpan-code/geist-org/geist-ui/components/badge/__tests__/__snapshots__/anchor.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BadgeAnchor should be support multiple position 1`] = `
"<div class=\\"anchor\\"><button>btn</button><sup><span class=\\"badge\\">test<style>
.badge {
display: inline-block;
border-radius: 16px;
font-variant: tabular-nums;
... | 2,491 |
0 | petrpan-code/geist-org/geist-ui/components/badge/__tests__ | petrpan-code/geist-org/geist-ui/components/badge/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Badge should re-render when size changed 1`] = `ReactWrapper {}`;
exports[`Badge should re-render when size changed 2`] = `ReactWrapper {}`;
exports[`Badge should render different types 1`] = `
LoadedCheerio {
"0": Node {
"attribs": Object {},
"children":... | 2,492 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/breadcrumbs/breadcrumbs-item.tsx | import Link from '../link'
import { Props as LinkBasicProps } from '../link/link'
import React, { useMemo } from 'react'
import { pickChild } from '../utils/collections'
import BreadcrumbsSeparator from './breadcrumbs-separator'
import useClasses from '../use-classes'
interface Props {
href?: string
nextLink?: boo... | 2,493 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/breadcrumbs/breadcrumbs-separator.tsx | import React from 'react'
import useScale, { withScale } from '../use-scale'
import useClasses from '../use-classes'
interface Props {
className?: string
}
const defaultProps = {
className: '',
}
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
export type BreadcrumbsSeparatorProps = Props & Nativ... | 2,494 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/breadcrumbs/breadcrumbs.tsx | import React, { ReactNode, useMemo } from 'react'
import useTheme from '../use-theme'
import BreadcrumbsSeparator from './breadcrumbs-separator'
import { addColorAlpha } from '../utils/color'
import useScale, { withScale } from '../use-scale'
interface Props {
separator?: string | ReactNode
className?: string
}
c... | 2,495 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/breadcrumbs/index.ts | import Breadcrumbs from './breadcrumbs'
import BreadcrumbsItem from './breadcrumbs-item'
import BreadcrumbsSeparator from './breadcrumbs-separator'
export type BreadcrumbsComponentType = typeof Breadcrumbs & {
Item: typeof BreadcrumbsItem
Separator: typeof BreadcrumbsSeparator
}
;(Breadcrumbs as BreadcrumbsCompone... | 2,496 |
0 | petrpan-code/geist-org/geist-ui/components/breadcrumbs | petrpan-code/geist-org/geist-ui/components/breadcrumbs/__tests__/breadcrumbs.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Breadcrumbs } from 'components'
describe('Breadcrumbs', () => {
it('should render correctly', () => {
const wrapper = mount(
<Breadcrumbs>
<Breadcrumbs.Item>test-1</Breadcrumbs.Item>
</Breadcrumbs>,
)
expect(wrapper.htm... | 2,497 |
0 | petrpan-code/geist-org/geist-ui/components/breadcrumbs/__tests__ | petrpan-code/geist-org/geist-ui/components/breadcrumbs/__tests__/__snapshots__/breadcrumbs.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Breadcrumbs should redefined all separators 1`] = `
"<nav class=\\"\\"><span class=\\"breadcrumbs-item\\">test-1</span><div class=\\"separator\\">*<style>
.separator {
display: inline-flex;
user-select: none;
pointer-events: none... | 2,498 |
0 | petrpan-code/geist-org/geist-ui/components | petrpan-code/geist-org/geist-ui/components/button-dropdown/button-dropdown-context.ts | import React from 'react'
import { NormalTypes } from '../utils/prop-types'
export interface ButtonDropdownConfig {
type?: NormalTypes
auto?: boolean
disabled?: boolean
loading?: boolean
}
const defaultContext = {
type: 'default' as NormalTypes,
auto: false,
disabled: false,
loading: false,
}
export ... | 2,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.