Skip to content

Commit

Permalink
Merge pull request #65 from AlecsMissangu/updated-data-catalog-compon…
Browse files Browse the repository at this point in the history
…ents

TELFE-162 TELFE-174 Updated data catalog components
  • Loading branch information
AlecsMissangu committed May 29, 2024
2 parents 8765657 + 1976493 commit dbddcc7
Show file tree
Hide file tree
Showing 62 changed files with 3,462 additions and 981 deletions.
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/telicent-oss/telicent-ds.git"
},
"type": "module",
"version": "0.0.3-rc3",
"version": "0.0.4",
"private": false,
"dependencies": {
"@emotion/react": "^11.10.6",
Expand All @@ -16,7 +16,10 @@
"@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "^5.15.14",
"@mui/x-tree-view": "7.3.1",
"@react-spring/web": "9.7.3",
"@tanstack/react-query": "^5.18.0",
"@telicent-oss/ontologyservice": "^0.0.1",
"classnames": "^2.3.1",
Expand Down Expand Up @@ -48,7 +51,9 @@
"chromatic": "chromatic --exit-zero-on-changes",
"css": "npx tailwindcss -i ./src/index.css -o ./src/main.css",
"prestart": "yarn run css",
"prebuild": "yarn clean"
"prebuild": "yarn clean",
"bump:prerelease": "yarn version --prerelease && git push && git push --tags",
"bump:pre": "yarn bump:prerelease"
},
"peerDependencies": {
"@tanstack/react-query": "^5.18.0",
Expand All @@ -70,16 +75,17 @@
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@commitlint/cli": "^17.1.2",
"@commitlint/cli": "17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@storybook/addon-a11y": "^7.6.7",
"@storybook/addon-actions": "^7.6.7",
"@storybook/addon-docs": "^7.6.7",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-essentials": "7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/blocks": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-vite": "^7.6.7",
"@storybook/test": "^8.1.2",
"@testing-library/dom": "^9.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
Expand All @@ -95,7 +101,7 @@
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.2",
"chromatic": "^6.15.0",
"commitizen": "^4.2.5",
"commitizen": "4.2.5",
"cross-env": "^7.0.3",
"cssnano": "^5.0.14",
"cz-conventional-changelog": "^3.3.0",
Expand All @@ -119,8 +125,8 @@
"postcss": "^8.4.29",
"postcss-cli": "^10.1.0",
"postcss-import": "^15.1.0",
"react-scripts": "^5.0.0",
"release-please": "^15.6.0",
"react-scripts": "5.0.0",
"release-please": "15.6.0",
"remark-gfm": "^3.0.1",
"rollup": "^4.5.0",
"rollup-plugin-copy": "^3.5.0",
Expand Down
7 changes: 7 additions & 0 deletions src/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ export type { IconStyle } from "./contexts/OntologyStyles";
export * from "./components";
export { default as useDebounce } from "./hooks/useDebounce";

// V1
export * from "./v1/components/data-display";
export * from "./v1/components/feedback";
export * from "./v1/components/inputs";
export * from "./v1/components/layout";
export * from "./v1/components/surfaces";
export { default as UIThemeProvider } from "./v1/theme/UIThemeProvider";
26 changes: 18 additions & 8 deletions src/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -209,6 +209,8 @@ textarea {
/* 1 */
line-height: inherit;
/* 1 */
letter-spacing: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
Expand All @@ -232,9 +234,9 @@ select {
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
Expand Down Expand Up @@ -583,6 +585,10 @@ html {
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

::backdrop {
Expand Down Expand Up @@ -633,6 +639,10 @@ html {
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

/*
Expand Down Expand Up @@ -12795,7 +12805,7 @@ code {
color: rgb(29 29 29 / 0.7);
}

:is(.dark .MuiTypography-root.MuiFormControlLabel-label.Mui-disabled) {
.MuiTypography-root.MuiFormControlLabel-label.Mui-disabled:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(144 144 144 / var(--tw-text-opacity));
}
Expand All @@ -12808,7 +12818,7 @@ code {
font-family: Figtree, Avenir, Corbel, source-sans-pro, sans-serif;
}

:is(.dark .theme__text) {
.theme__text:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(245 245 245 / var(--tw-text-opacity));
}
Expand All @@ -12817,7 +12827,7 @@ code {
letter-spacing: 0.05em;
}

:is(.dark .theme__bg) {
.theme__bg:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(29 29 29 / var(--tw-bg-opacity));
}
Expand All @@ -12841,7 +12851,7 @@ code {
opacity: 1;
}

:is(.dark .dark\:text-whiteSmoke) {
.dark\:text-whiteSmoke:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(245 245 245 / var(--tw-text-opacity));
}
Expand Down
102 changes: 102 additions & 0 deletions src/v1/components/data-display/Chip/Chip.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import Box from "@mui/material/Box";

import Chip from "./Chip";

const meta = {
title: "Data display/Chip",
component: Chip,
parameters: {
docs: {
description: {
component: "Buttons allow users to take actions, and make choices, with a single tap.",
},
},
},
tags: ["autodocs"],
args: { label: "Chip" },
argTypes: {
disabled: {
description: "If true, the component is disabled.",
type: "boolean",
table: {
defaultValue: {
summary: "false",
},
},
},
label: {
description: "The content of the component.",
},
onClick: {
description: "Callback fired when the chip is clicked.",
type: "function",
},
onDelete: {
description:
"Callback fired when the delete icon is clicked. If set, the delete icon will be shown.",
type: "function",
},
size: {
description: "The size of the component.",
table: {
defaultValue: {
summary: "medium",
},
},
control: "select",
options: ["small", "medium", "large"],
},
},
decorators: (Story) => (
<Box display="flex" gap={2}>
{Story()}
</Box>
),
} satisfies Meta<typeof Chip>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Filled: Story = {};

export const Outlined: Story = {
args: {
variant: "outlined",
},
};

export const ClickableChips: Story = {
render: (args) => (
<>
<Chip onClick={fn()} {...args} />
<Chip variant="outlined" onClick={fn()} {...args} />
</>
),
parameters: {
docs: {
description: {
story:
"Chips with the `onClick` prop defined change appearance on focus, hover, and click.",
},
},
},
};

export const DeletableChips: Story = {
render: (args) => (
<>
<Chip onDelete={fn()} {...args} />
<Chip variant="outlined" onDelete={fn()} {...args} />
</>
),
parameters: {
docs: {
description: {
story:
"Chips with the onDelete prop defined will display a delete icon which changes appearance on hover.",
},
},
},
};
22 changes: 22 additions & 0 deletions src/v1/components/data-display/Chip/Chip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import MUIChip, { ChipProps as MUIChipProps } from "@mui/material/Chip";

export type ChipProps = Omit<
MUIChipProps,
| "avatar"
| "children"
| "classes"
| "clickable"
| "color"
| "component"
| "deleteIcon"
| "icon"
| "skipFocusWhenDisabled"
| "sx"
>;

const Chip: React.FC<ChipProps> = ({ variant = "filled", ...chipProps }) => (
<MUIChip variant={variant} color="primary" {...chipProps} />
);

export default Chip;
22 changes: 22 additions & 0 deletions src/v1/components/data-display/Divider/Divider.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Meta, StoryObj } from "@storybook/react";
import Divider from "./Divider";

const meta = {
component: Divider,
} satisfies Meta<typeof Divider>;

export default meta;

export type DividerStory = StoryObj<typeof meta>;

export const Basic: DividerStory = {
args: {
},
parameters: {
docs: {
description: {
story: `A line`,
},
},
},
};
4 changes: 4 additions & 0 deletions src/v1/components/data-display/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

import Divider from '@mui/material/Divider';

export default Divider;
11 changes: 11 additions & 0 deletions src/v1/components/data-display/FontAwesomeIcons/DownArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import { FontAwesomeIcon, FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
import { faAngleDown } from "@fortawesome/free-solid-svg-icons";

type DownArrowIconProps = Omit<FontAwesomeIconProps, "icon">;

const DownArrow: React.FC<DownArrowIconProps> = (iconProps) => (
<FontAwesomeIcon icon={faAngleDown} {...iconProps} />
);

export default DownArrow;
11 changes: 11 additions & 0 deletions src/v1/components/data-display/FontAwesomeIcons/SearchIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import { FontAwesomeIcon, FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
import { faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons";

type SearchIconProps = Omit<FontAwesomeIconProps, "icon">;

const SearchIcon: React.FC<SearchIconProps> = (faIconProps) => (
<FontAwesomeIcon icon={faMagnifyingGlass} {...faIconProps} />
);

export default SearchIcon;
2 changes: 2 additions & 0 deletions src/v1/components/data-display/FontAwesomeIcons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as DownArrowIcon } from "./DownArrowIcon";
export { default as SearchIcon } from "./SearchIcon";
Loading

0 comments on commit dbddcc7

Please sign in to comment.