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

feat: add HasManyFields2 #1107

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
docs: false,
},
},
'@storybook/addon-controls',
'@storybook/addon-knobs',
'@storybook/addon-actions',
{
Expand Down
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"prettier.configPath": ".prettierrc.json",
"eslint.format.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
"react-dom": ">= 16.8"
},
"dependencies": {
"@dnd-kit/core": "^6.0.0",
"@dnd-kit/modifiers": "^6.0.0",
"@dnd-kit/sortable": "^7.0.0",
"@dnd-kit/utilities": "^3.1.0",
"@fortawesome/fontawesome-free": "^6.2.0",
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@popperjs/core": "^2.10.1",
Expand Down Expand Up @@ -90,15 +94,16 @@
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@jest/types": "^27.5.1",
"@storybook/addon-a11y": "^6.3.11",
"@storybook/addon-actions": "^6.3.11",
"@storybook/addon-essentials": "^6.3.11",
"@storybook/addon-knobs": "^6.3.1",
"@storybook/addon-links": "^6.3.11",
"@storybook/addon-storysource": "^6.3.11",
"@storybook/addon-viewport": "^6.3.11",
"@storybook/addons": "^6.3.11",
"@storybook/react": "^6.3.11",
"@storybook/addon-a11y": "^6.4.22",
"@storybook/addon-actions": "^6.4.22",
"@storybook/addon-controls": "^6.5.8",
"@storybook/addon-essentials": "^6.4.22",
"@storybook/addon-knobs": "^6.4.0",
"@storybook/addon-links": "^6.4.22",
"@storybook/addon-storysource": "^6.4.22",
"@storybook/addon-viewport": "^6.4.22",
"@storybook/addons": "^6.4.22",
"@storybook/react": "^6.4.22",
"@testing-library/dom": "^8.13.0",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^11.2.6",
Expand Down Expand Up @@ -144,6 +149,8 @@
"jest": "^27.5.1",
"jsdom": "^11.12.0",
"jsdom-global": "^3.0.2",
"mobx": "^6.5.0",
"mobx-react-lite": "^3.3.0",
"prettier": "^2.5.1",
"raf-stub": "^3.0.0",
"react": "^16.14.0",
Expand Down
111 changes: 66 additions & 45 deletions src/components/Button/Button.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { action } from '@storybook/addon-actions';
import { text, boolean, select } from '@storybook/addon-knobs';
import React from 'react';
import React, { useRef, useCallback, useState } from 'react';
import { buttonColors } from '../../tooling/colors';
import DropdownItem from '../Dropdown/DropdownItem';
import DropdownMenu from '../Dropdown/DropdownMenu';
Expand All @@ -11,24 +11,41 @@ import ButtonDropdown from './ButtonDropdown';
import ButtonGroup from './ButtonGroup';
import ButtonToolbar from './ButtonToolbar';
import ConfirmationButton from './ConfirmationButton';
import Tooltip from '../Tooltip/Tooltip';

export default {
title: 'Buttons',
component: Button,
};

export const LiveExample = () => (
<Button
color={select('color', buttonColors, 'primary')}
block={boolean('block', false)}
disabled={boolean('disabled', false)}
outline={boolean('outline', false)}
active={boolean('active', false)}
size={select('size', ['', 'sm', 'lg'])}
>
{text('Label', 'Click Me')}
</Button>
);
export const LiveExample = () => {
// const ref = useRef(null);
const [tooltipTarget, setTooltipTarget] = useState();
const callbackRef = useCallback(node => {
if (node) {
setTooltipTarget(node);
}
}, []);
return (
<span ref={callbackRef}>
{
tooltipTarget && <Tooltip target={tooltipTarget}>
some tooltip stuff
</Tooltip>
}
<Button
color={select('color', buttonColors, 'primary')}
block={boolean('block', false)}
disabled={boolean('disabled', false)}
outline={boolean('outline', false)}
active={boolean('active', false)}
size={select('size', ['', 'sm', 'lg'])}
>
{text('Label', 'Click Me')}
</Button>
</span>
);
};

export const Colors = () => (
<ButtonToolbar>
Expand All @@ -45,38 +62,42 @@ export const Colors = () => (
</ButtonToolbar>
);

export const Disabled = () => (
<ButtonToolbar>
<Button disabled>Default</Button>
<Button disabled color="primary">
Primary
</Button>
<Button disabled color="secondary">
Secondary
</Button>
<Button disabled color="success">
Success
</Button>
<Button disabled color="info">
Info
</Button>
<Button disabled color="warning">
Warning
</Button>
<Button disabled color="danger">
Danger
</Button>
<Button disabled color="dark">
Dark
</Button>
<Button disabled color="light">
Light
</Button>
<Button disabled color="link">
Link
</Button>
</ButtonToolbar>
);
export const Disabled = () => {
// const ref = useRef(null);
return (
<ButtonToolbar>
<Tooltip target={tooltipTarget}>Some thing here</Tooltip>
<Button ref={callbackRef} disabled>Default</Button>
<Button disabled color="primary">
Primary
</Button>
<Button disabled color="secondary">
Secondary
</Button>
<Button disabled color="success">
Success
</Button>
<Button disabled color="info">
Info
</Button>
<Button disabled color="warning">
Warning
</Button>
<Button disabled color="danger">
Danger
</Button>
<Button disabled color="dark">
Dark
</Button>
<Button disabled color="light">
Light
</Button>
<Button disabled color="link">
Link
</Button>
</ButtonToolbar>
);
};

export const Outline = () => (
<ButtonToolbar>
Expand Down
Loading