Skip to content
Open
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
docs/node_modules
docs/build
docs/.docusaurus
theme-builder/node_modules
theme-builder/.next
node_modules
coverage
dist
3 changes: 3 additions & 0 deletions docs/src/pages/kitchen-sink.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const KitchenSink = () => {
<Stack gap="30px">
<InputField label="Basic Input" className="input-label white-text">
<Input
hiddenLabel="Basic Input"
style={{ color: 'black' }}
placeholder="placeholder"
value={field}
Expand All @@ -181,6 +182,7 @@ const KitchenSink = () => {
/>
</InputField>
<InputField
hiddenLabel="Input with Error"
className="input-label white-text"
label="Input With Error"
htmlFor="basicInput"
Expand All @@ -190,6 +192,7 @@ const KitchenSink = () => {
requiredMarkerColor="#FF6347"
>
<Input
hiddenLabel="Input with Error"
style={{ color: 'black' }}
id="basicInput"
placeholder="placeholder"
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"packages": [
".",
"docs"
"docs",
"theme-builder"
],
"version": "independent",
"npmClient": "yarn"
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"semantic-release": "semantic-release"
},
"peerDependencies": {
"react": ">=16"
"react": ">= 16.8",
"react-dom": ">= 16.8"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -73,7 +74,7 @@
"prism-react-renderer": "^1.0.2",
"react": "^16.13.0",
"react-docgen-typescript-loader": "^3.7.0",
"react-dom": "^16.13.0",
"react-dom": "^16.13.1",
"react-live": "^2.2.2",
"rollup-plugin-postcss": "^3.1.1",
"semantic-release": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Image = forwardRef(function Image(
) {
const theme = useTheme();

warning(!alt, 'Images require an `alt` attribute to be accessible.');
warning(alt, 'Images require an `alt` attribute to be accessible.');

return (
<Box as="img" ref={ref} src={src} alt={alt} {...theme.Image} {...props} />
Expand Down
2 changes: 1 addition & 1 deletion src/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Input = forwardRef(function Input(
const componentStyles = useComponentStyles('Input');

warning(
!hiddenLabel,
hiddenLabel,
'Inputs without associated labels require a `hiddenLabel` attribute to be accessible.'
);

Expand Down
3 changes: 1 addition & 2 deletions src/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ export const ModalFooter = forwardRef(function ModalFooter(
{ children, ...props }: ModalFooterProps,
ref
) {
// const theme = useTheme();
const componentStyles = useComponentStyles('ModalFooter');
return (
<Box ref={ref} {...componentStyles} {...props}>
<Box ref={ref} px={6} py={3} {...componentStyles} {...props}>
{children}
</Box>
);
Expand Down
4 changes: 4 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export interface ThemeComponent extends React.CSSProperties, PseudoBoxProps {}
export interface MinervaTheme extends Theme {
Button?: React.CSSProperties;
Drawer?: React.CSSProperties;
Heading?: React.CSSProperties;
Modal?: React.CSSProperties;
ModalContent?: React.CSSProperties;
ModalBody?: React.CSSProperties;
ModalHeader?: React.CSSProperties;
ModalFooter?: React.CSSProperties;
Text?: React.CSSProperties;
Input?: ThemeComponent;
Expand Down Expand Up @@ -77,6 +79,7 @@ const defaultTheme: MinervaTheme = {
},
Checkbox: {},
Drawer: {},
Heading: { fontWeight: 'bold' },
Image: {},
Input: {
appearance: 'none',
Expand Down Expand Up @@ -106,6 +109,7 @@ const defaultTheme: MinervaTheme = {
Link: {},
Tabs: {},
Modal: {},
ModalHeader: {},
ModalBody: {},
ModalFooter: {},
ModalContent: {},
Expand Down
6 changes: 6 additions & 0 deletions test/__snapshots__/alert.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ exports[`<Alert /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
margin: 0;
font-size: 16px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
line-height: normal;
}

.c0 {
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #e5e7eb;
line-height: 1;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
background-color: #e5e7eb;
line-height: 1;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
padding: 16px;
border-radius: 5px;
-webkit-align-items: center;
Expand All @@ -30,6 +35,7 @@ exports[`<Alert /> should render 1`] = `
align-items: center;
background-color: #e5e7eb;
line-height: 1;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
}

.c2 {
Expand Down
7 changes: 7 additions & 0 deletions test/__snapshots__/button.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ exports[`<Button /> should change style if disabled 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down Expand Up @@ -87,6 +89,7 @@ exports[`<Button /> should contain spinner with \`isLoading\` prop 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
height: 20px;
border-width: 2px;
width: 20px;
Expand All @@ -112,10 +115,12 @@ exports[`<Button /> should contain spinner with \`isLoading\` prop 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down Expand Up @@ -196,10 +201,12 @@ exports[`<Button /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/heading.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<Text /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
margin: 0;
font-weight: bold;
font-family: inherit;
Expand Down
12 changes: 12 additions & 0 deletions test/__snapshots__/hooks.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ exports[`useClipboard should render Clipboard Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down Expand Up @@ -74,6 +76,7 @@ exports[`useClipboard should render Clipboard Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
Expand Down Expand Up @@ -128,10 +131,12 @@ exports[`useDisclosure should render Disclosure Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down Expand Up @@ -209,19 +214,23 @@ exports[`useLocalStorage should render Local Storage Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
margin: 0;
font-size: 16px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
line-height: normal;
}

.c0 {
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
outline: none;
cursor: pointer;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
background-color: #fff;
border-width: 1px;
color: #374151;
Expand Down Expand Up @@ -306,6 +315,7 @@ exports[`useMedia should render Media Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
height: 100px;
width: 100px;
}
Expand All @@ -323,8 +333,10 @@ exports[`useNetwork should render Network Component 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
margin: 0;
font-size: 16px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
line-height: normal;
}

Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/input.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<Input /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/inputField.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ exports[`<InputField> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
padding-bottom: 0.5rem;
}

.c2 {
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/link.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<Link /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
font-size: 16px;
}

Expand Down
4 changes: 4 additions & 0 deletions test/__snapshots__/select.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<Select /> should change style if disabled 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
width: 20px;
height: 20px;
stroke: currentColor;
Expand All @@ -15,6 +16,7 @@ exports[`<Select /> should change style if disabled 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
position: relative;
display: block;
}
Expand Down Expand Up @@ -158,6 +160,7 @@ exports[`<Select /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
width: 20px;
height: 20px;
stroke: currentColor;
Expand All @@ -168,6 +171,7 @@ exports[`<Select /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
position: relative;
display: block;
}
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/skeleton.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<Skeleton /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
width: 100%;
height: 100%;
display: -webkit-box;
Expand All @@ -28,6 +29,7 @@ exports[`<Skeleton /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
height: 2rem;
width: 100%;
border-radius: 5px;
Expand Down
4 changes: 4 additions & 0 deletions test/__snapshots__/stack.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ exports[`<Stack /> should change margin with gap prop 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
}

.c0 {
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand Down Expand Up @@ -48,12 +50,14 @@ exports[`<Stack /> should render 1`] = `
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
}

.c0 {
box-sizing: border-box;
min-width: 0;
color: #374151;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand Down
Loading