Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123 tabs #129

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@electrocrud/shared": "link:./packages/shared",
"@electrocrud/tables": "link:./packages/tables",
"@electrocrud/utils": "link:./packages/utils",
"@electrocrud/tabs": "link:./packages/tabs",
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11",
"@emotion/styled": "^11",
Expand Down
5 changes: 3 additions & 2 deletions packages/buttons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@
},
"dependencies": {
"@chakra-ui/react": "^2.4.9",
"@electrocrud/utils": "link:./../utils",
"arc-hash": "^3.0.0",
"chroma-js": "^2.4.2",
"csstype": "^3.1.1",
"eslint-plugin-prettier": "^4.2.1",
"flatted": "^3.2.7",
"framer-motion": "^9.0.2",
"react": "^18.2.0",
"react-icons": "^4.7.1",
"ts-toolbelt": "^9.6.0",
"underscore": "^1.13.6",
"@electrocrud/utils": "link:./../utils"
"underscore": "^1.13.6"
}
}
3 changes: 1 addition & 2 deletions packages/buttons/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
export * from './save-button';
export * from './ripple-button';
export * from './actions-dropdown-menu';
Expand All @@ -8,4 +7,4 @@ export * from './cancel-button';
export * from './add-button';
export * from './delete-button';
export * from './lock-button';
export * from './action-button';
export * from './action-button';
4 changes: 3 additions & 1 deletion packages/feedback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
"dependencies": {
"@chakra-ui/react": "^2.4.9",
"chroma-js": "^2.4.2",
"csstype": "^3.1.1",
"framer-motion": "^9.0.2",
"react": "^18.2.0",
"react-icons": "^4.7.1",
"ts-toolbelt": "^9.6.0"
"ts-toolbelt": "^9.6.0",
"underscore": "^1.13.6"
}
}
1 change: 1 addition & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@chakra-ui/react": "^2.4.9",
"arc-hash": "^3.0.0",
"chroma-js": "^2.4.2",
"csstype": "^3.1.1",
"eslint-plugin-prettier": "^4.2.1",
"flatted": "^3.2.7",
"framer-motion": "^9.0.2",
Expand Down
4 changes: 3 additions & 1 deletion packages/tables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
},
"dependencies": {
"@chakra-ui/react": "^2.4.9",
"csstype": "^3.1.1",
"framer-motion": "^9.0.2",
"react": "^18.2.0",
"react-icons": "^4.7.1",
"ts-toolbelt": "^9.6.0"
"ts-toolbelt": "^9.6.0",
"underscore": "^1.13.6"
}
}
5 changes: 5 additions & 0 deletions packages/tabs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"extends": [
"../../.eslintrc.js"
],
};
11 changes: 11 additions & 0 deletions packages/tabs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `@electrocrud/tabs`

> TODO: description

## Usage

```
const tabs = require('@electrocrud/tabs');

// TODO: DEMONSTRATE API
```
19 changes: 19 additions & 0 deletions packages/tabs/__tests__/tabs.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import { TabProperties, Tabs } from '../src/tabs';
import { ChakraProvider } from '@chakra-ui/react';
import theme from '../../../src/renderer/theme/theme';
import { TabClose } from '../src/list';

test('tab close icon', () => {
const clickFunction = jest.fn();
const { getByTestId } = render(
<ChakraProvider theme={theme}>
<TabClose onClose={clickFunction} />
</ChakraProvider>
);

const tabClose = getByTestId('tab-close');
fireEvent.click(tabClose);
expect(clickFunction).toHaveBeenCalledTimes(1);
});
15 changes: 15 additions & 0 deletions packages/tabs/lib/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* src/tabs.scss */
.chakra-tabs__tab[aria-selected=true] {
position: relative;
border-bottom: 0px;
}
.chakra-tabs__tab[aria-selected=true]::after {
content: "";
position: absolute;
width: 0px;
height: 2px;
bottom: 0px;
background-color: var(--chakra-colors-primary-400);
animation: animateborder 0.5s ease-in-out 1 normal forwards;
animation-iteration-count: 1;
}
5 changes: 5 additions & 0 deletions packages/tabs/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { TabProperties, Tabs, TabsAPI, TabsProperties } from './tabs.js';
import 'react';
import '@chakra-ui/react';
import 'csstype';
import 'react-icons';
Loading