Skip to content

Commit 41a89b4

Browse files
committed
Minor fixes.
1 parent adcdebe commit 41a89b4

27 files changed

+85
-44
lines changed

jest/setup.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ResizeObserver {
2+
observe() {}
3+
unobserve() {}
4+
disconnect() {}
5+
}
6+
7+
window.ResizeObserver = ResizeObserver

src/components/button/button.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Button, IconButton } from "."
99
import readme from "./README.md"
1010
import { iconsList } from "src/components/icon"
1111

12-
const buttonStory = storiesOf("COMPONENTS|Controls/Button", module)
13-
const icons: string[] = Object.keys(iconsList)
12+
const buttonStory = storiesOf("Input/Button", module)
13+
const icons = Object.keys(iconsList)
1414

1515
const subData = {
1616
readme: {

src/components/checkbox/checkbox.stories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getGutterHeight } from "src/theme/utils"
77
import { readmeCleanup } from "utils/readme"
88
import readme from "./README.md"
99

10-
const checkBoxStory = storiesOf("COMPONENTS|Controls/Checkbox", module)
10+
const checkBoxStory = storiesOf("Input/Checkbox", module)
1111

1212
const position = ["left", "right"]
1313

@@ -22,7 +22,7 @@ checkBoxStory.add(
2222
"Controlled Checkbox",
2323
() => {
2424
const [checked, setChecked] = useState(false)
25-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
25+
const handleChange = e => {
2626
setChecked(e.currentTarget.checked)
2727
}
2828
return (
@@ -36,7 +36,7 @@ checkBoxStory.add(
3636
"Labeled Checkbox",
3737
() => {
3838
const [checked, setChecked] = useState(false)
39-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
39+
const handleChange = e => {
4040
setChecked(e.currentTarget.checked)
4141
}
4242
return (
@@ -55,7 +55,7 @@ checkBoxStory.add(
5555
"Disabled Checkobox",
5656
() => {
5757
const [checked, setChecked] = useState(false)
58-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
58+
const handleChange = e => {
5959
setChecked(e.currentTarget.checked)
6060
}
6161
return (

src/components/drops/drop/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Flex from "src/components/templates/flex"
66
import readme from "./README.md"
77
import Drop from "./index"
88

9-
const story = storiesOf("COMPONENTS|Drops/Drop", module)
9+
const story = storiesOf("Drops/Drop", module)
1010

1111
const subData = {
1212
readme: {

src/components/drops/menu/dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from "styled-components"
33
import { useVirtualizer } from "@tanstack/react-virtual"
44
import Flex from "src/components/templates/flex"
55
import Search from "src/components/search"
6-
import { Box } from "src/index"
6+
import { Box } from "src/components/templates/box"
77

88
const Container = styled(Flex)`
99
${({ hideShadow }) =>

src/components/drops/menu/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Icon } from "src/components/icon"
1010
import readme from "./README.md"
1111
import Menu from "./index"
1212

13-
const story = storiesOf("COMPONENTS|Drops/Menu", module)
13+
const story = storiesOf("Drops/Menu", module)
1414

1515
const subData = {
1616
readme: {

src/components/drops/popover/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Button } from "src/components/button"
88
import readme from "./README.md"
99
import Popover from "./index"
1010

11-
const story = storiesOf("COMPONENTS|Drops/Popover", module)
11+
const story = storiesOf("Drops/Popover", module)
1212

1313
const subData = {
1414
readme: {

src/components/drops/tooltip/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Button } from "src/components/button"
77
import readme from "./README.md"
88
import Tooltip from "./index"
99

10-
const story = storiesOf("COMPONENTS|Drops/Tooltip", module)
10+
const story = storiesOf("Drops/Tooltip", module)
1111

1212
const subData = {
1313
readme: {

src/components/filter-box/filter-box.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FilterBox, FilterBoxProcessing } from "."
66
import { Text } from "src/components/typography"
77
import readme from "./README.md"
88

9-
const filterBoxStory = storiesOf("COMPONENTS|Controls/Filter Box", module)
9+
const filterBoxStory = storiesOf("Input/Filter Box", module)
1010

1111
const subData = {
1212
readme: {

src/components/icon/icon-list.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getColor } from "../../theme"
1010
import { iconsList } from "./icons-list"
1111
import { Icon } from "."
1212

13-
const iconListStory = storiesOf("COMPONENTS|Icons", module)
13+
const iconListStory = storiesOf("Icons/List", module)
1414

1515
const iconsExposed = Object.keys(iconsList)
1616

src/components/icon/icon.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { iconsList } from "./icons-list"
77
import { Icon } from "."
88
import readme from "./README.md"
99

10-
const iconStory = storiesOf("COMPONENTS|Utils/Icon", module)
10+
const iconStory = storiesOf("Icons/Icon", module)
1111

1212
const subData = {
1313
readme: {

src/components/intersection/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Flex from "src/components/templates/flex"
55
import readme from "./README.md"
66
import Intersection from "./index"
77

8-
const story = storiesOf("COMPONENTS|Intersection", module)
8+
const story = storiesOf("Utils/Intersection", module)
99

1010
const subData = {
1111
readme: {

src/components/modal/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Modal, { ModalContent, ModalHeader, ModalBody, ModalFooter, ModalCloseBut
55
import Flex from "../templates/flex"
66
import { Button } from "../button"
77

8-
const modalStory = storiesOf("COMPONENTS|Modal")
8+
const modalStory = storiesOf("Utils/Modal")
99

1010
modalStory.add("Modal", () => {
1111
return (

src/components/pill/index.stories.js

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import Flex from "src/components/templates/flex"
55
import Pill from "./index"
66
import MasterCard from "./mastercard"
77

8-
9-
const story = storiesOf("COMPONENTS|Pills")
8+
const story = storiesOf("Atoms/Pills")
109

1110
const Custom = () => (
1211
<Flex gap={4}>
@@ -31,16 +30,32 @@ const Pills = () => (
3130
<Pill flavour="neutral">Neutral</Pill>
3231
</Flex>
3332
<Flex gap={4}>
34-
<Pill flavour="warning" size="small">Warning</Pill>
35-
<Pill flavour="error" size="small">Error</Pill>
36-
<Pill flavour="success" size="small">Success</Pill>
37-
<Pill flavour="neutral" size="small">Neutral</Pill>
33+
<Pill flavour="warning" size="small">
34+
Warning
35+
</Pill>
36+
<Pill flavour="error" size="small">
37+
Error
38+
</Pill>
39+
<Pill flavour="success" size="small">
40+
Success
41+
</Pill>
42+
<Pill flavour="neutral" size="small">
43+
Neutral
44+
</Pill>
3845
</Flex>
3946
<Flex gap={4}>
40-
<Pill flavour="warning" size="large">Warning</Pill>
41-
<Pill flavour="error" size="large">Error</Pill>
42-
<Pill flavour="success" size="large">Success</Pill>
43-
<Pill flavour="neutral" size="large">Neutral</Pill>
47+
<Pill flavour="warning" size="large">
48+
Warning
49+
</Pill>
50+
<Pill flavour="error" size="large">
51+
Error
52+
</Pill>
53+
<Pill flavour="success" size="large">
54+
Success
55+
</Pill>
56+
<Pill flavour="neutral" size="large">
57+
Neutral
58+
</Pill>
4459
</Flex>
4560
</Flex>
4661
)
@@ -190,11 +205,18 @@ const PillsTiny = () => (
190205
const MasterCards = () => (
191206
<Flex column gap={4}>
192207
<Flex gap={2}>
193-
<MasterCard pillLeft={{ flavour: "error", text: "3" }} pillRight={{ flavour: "warning", text: "2" }} />
208+
<MasterCard
209+
pillLeft={{ flavour: "error", text: "3" }}
210+
pillRight={{ flavour: "warning", text: "2" }}
211+
/>
194212
<MasterCard />
195213
</Flex>
196214
<Flex gap={2}>
197-
<MasterCard pillLeft={{ flavour: "error", text: "3" }} pillRight={{ flavour: "warning", text: "2" }} size="large" />
215+
<MasterCard
216+
pillLeft={{ flavour: "error", text: "3" }}
217+
pillRight={{ flavour: "warning", text: "2" }}
218+
size="large"
219+
/>
198220
<MasterCard size="large" />
199221
</Flex>
200222
</Flex>
@@ -203,11 +225,19 @@ const MasterCards = () => (
203225
const AlertMasterCards = () => (
204226
<Flex column gap={4}>
205227
<Flex gap={2}>
206-
<AlertMasterCard onClick={() => console.log("test")} pillLeft={{ flavour: "error", text: "3" }} pillRight={{ flavour: "warning", text: "2" }} />
228+
<AlertMasterCard
229+
onClick={() => console.log("test")}
230+
pillLeft={{ flavour: "error", text: "3" }}
231+
pillRight={{ flavour: "warning", text: "2" }}
232+
/>
207233
<AlertMasterCard />
208234
</Flex>
209235
<Flex gap={2}>
210-
<AlertMasterCard pillLeft={{ flavour: "error", text: "3" }} pillRight={{ flavour: "warning", text: "2" }} size="large" />
236+
<AlertMasterCard
237+
pillLeft={{ flavour: "error", text: "3" }}
238+
pillRight={{ flavour: "warning", text: "2" }}
239+
size="large"
240+
/>
211241
<AlertMasterCard size="large" />
212242
</Flex>
213243
</Flex>

src/components/radio-button/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import readme from "./README.md"
66

77
import RadioButton from "./index"
88

9-
const radioButtonStory = storiesOf("COMPONENTS|Controls/RadioButton", module)
9+
const radioButtonStory = storiesOf("Input/RadioButton", module)
1010

1111
const subData = {
1212
readme: {

src/components/sidebar/sidebar.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { readmeCleanup } from "utils/readme"
1010
import { Button } from "src/components/button"
1111
import readme from "./README.md"
1212

13-
const sidebarStory = storiesOf("COMPONENTS|Layout/Sidebar", module)
13+
const sidebarStory = storiesOf("Templates/Sidebar", module)
1414

1515
const subData = {
1616
readme: {

src/components/table/table.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const subData = {
1818
},
1919
jest: ["table.test.tsx"],
2020
}
21-
const tableStory = storiesOf("COMPONENTS|Controls/Table", module)
21+
const tableStory = storiesOf("Table/OldTable", module)
2222

2323
const initialState = [
2424
{

src/components/table/virtualized-table.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const subData = {
1818
},
1919
jest: ["table.test.tsx"],
2020
}
21-
const virtualizedTableStory = storiesOf("COMPONENTS|Controls/VirtualizedTable", module)
21+
const virtualizedTableStory = storiesOf("Table/OldVirtualizedTable", module)
2222

2323
const sampleNode = {
2424
node: { name: "Happiness" },

src/components/tableV2/netdataTable.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const colorFilter = {
2020
value: "",
2121
}
2222

23-
const StoryTable = storiesOf("COMPONENTS|NetdaTable")
23+
const StoryTable = storiesOf("Table/Table")
2424

2525
StoryTable.add("Base Table", () => {
2626
const [value, setValue] = useState()

src/components/tabs/__snapshots__/tabs.test.js.snap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ exports[`Tabs states * should render uncontrolled 1`] = `
2020
display: -webkit-flex;
2121
display: -ms-flexbox;
2222
display: flex;
23-
-webkit-flex: 1 1 auto;
24-
-ms-flex: 1 1 auto;
25-
flex: 1 1 auto;
23+
-webkit-flex: 0 0 auto;
24+
-ms-flex: 0 0 auto;
25+
flex: 0 0 auto;
2626
-webkit-flex-direction: row;
2727
-ms-flex-direction: row;
2828
flex-direction: row;
@@ -70,6 +70,7 @@ exports[`Tabs states * should render uncontrolled 1`] = `
7070
}
7171
7272
.c4 {
73+
white-space: nowrap;
7374
border-bottom: 4px solid #42B861;
7475
box-sizing: border-box;
7576
min-width: 80px;
@@ -91,6 +92,7 @@ exports[`Tabs states * should render uncontrolled 1`] = `
9192
}
9293
9394
.c5 {
95+
white-space: nowrap;
9496
border-bottom: 4px solid rgba(255,255,255,0.0);
9597
box-sizing: border-box;
9698
min-width: 80px;

src/components/tabs/styled.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const StyledTabs = styled(Flex).attrs(props => ({
2727
`
2828

2929
export const StyledTab = styled(Flex)`
30+
white-space: nowrap;
3031
border-bottom: ${({ small }) => (small ? "2px" : "4px")} solid
3132
${({ active }) => (active ? getColor("accent") : getColor(["transparent", "full"]))};
3233
box-sizing: border-box;
@@ -50,6 +51,7 @@ export const StyledTab = styled(Flex)`
5051
}
5152
`
5253
export const StyledTabMenu = styled(Flex)`
54+
white-space: nowrap;
5355
color: ${getColor("text")};
5456
padding: 4px 8px;
5557
background: ${({ active }) =>

src/components/tabs/tabs.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { readmeCleanup } from "utils/readme"
66
import { Tabs, Tab } from "."
77
import readme from "./README.md"
88

9-
const tabsStory = storiesOf("COMPONENTS|Tabs", module)
9+
const tabsStory = storiesOf("Templates/Tabs", module)
1010

1111
const subData = {
1212
readme: {

src/components/templates/box/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const subData = {
1212
},
1313
}
1414

15-
const flexStory = storiesOf("COMPONENTS|Templates/Box", module)
15+
const flexStory = storiesOf("Templates/Box", module)
1616

1717
flexStory.add(
1818
"With Different positions",

src/components/templates/flex/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import readme from "./README.md"
66

77
import Flex from "./index"
88

9-
const flexStory = storiesOf("COMPONENTS|Templates/Flex", module)
9+
const flexStory = storiesOf("Templates/Flex", module)
1010

1111
const subData = {
1212
readme: {

src/components/templates/layer/index.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const subData = {
1616
jest: ["index.test.js"],
1717
}
1818

19-
const story = storiesOf("COMPONENTS|Templates/Layer", module)
19+
const story = storiesOf("Templates/Layer", module)
2020

2121
story.add(
2222
"Simple",

src/components/toggle/toggle.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Toggle } from "."
55
import { readmeCleanup } from "utils/readme"
66
import readme from "./README.md"
77

8-
const toggleStory = storiesOf("COMPONENTS|Controls/Toggle", module)
8+
const toggleStory = storiesOf("Input/Toggle", module)
99

1010
const subData = {
1111
readme: {

src/components/typography/typography.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const controls = (
7777
</>
7878
)
7979

80-
storiesOf("COMPONENTS|Utils", module)
80+
storiesOf("Typography", module)
8181
.add(
8282
"Typography",
8383
() => (

0 commit comments

Comments
 (0)