diff --git a/package-lock.json b/package-lock.json index a95a25b4e..f89274a76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15001,9 +15001,9 @@ "dev": true }, "matchmediaquery": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/matchmediaquery/-/matchmediaquery-0.2.1.tgz", - "integrity": "sha1-IjxwBXk94D5HzpKxMoWnLEStos8=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/matchmediaquery/-/matchmediaquery-0.3.0.tgz", + "integrity": "sha512-u0dlv+VENJ+3YepvwSPBieuvnA6DWfaYa/ctwysAR13y4XLJNyt7bEVKzNj/Nvjo+50d88Pj+xL9xaSo6JmX/w==", "dev": true, "requires": { "css-mediaquery": "^0.1.2" @@ -19584,13 +19584,13 @@ } }, "react-responsive": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-4.1.0.tgz", - "integrity": "sha512-ZuDraf0qsJlyiTwzeva+foHx83IP6SIhru9o7BvMwQ4ZHjRIL5WjdgVNNrKSRbmeWO9rEJoMpabei/5lJn8KaA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-5.0.0.tgz", + "integrity": "sha512-oEimZ0FTCC3/pjGDEBHOz06nWbBNDIbMGOdRYp6K9SBUmrqgNAX77hTiqvmRQeLyI97zz4F4kiaFRxFspDxE+w==", "dev": true, "requires": { "hyphenate-style-name": "^1.0.0", - "matchmediaquery": "^0.2.1", + "matchmediaquery": "^0.3.0", "prop-types": "^15.6.1" } }, diff --git a/package.json b/package.json index b697e4f15..9283410b5 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "react-final-form": "^3.6.4", "react-popper": "^1.0.0", "react-relay": "github:coralproject/patched#react-relay", - "react-responsive": "^4.1.0", + "react-responsive": "^5.0.0", "react-test-renderer": "^16.4.1", "react-timeago": "^4.1.9", "react-with-state-props": "^2.0.4", diff --git a/src/core/build/createWebpackConfig.ts b/src/core/build/createWebpackConfig.ts index f90042dd3..ea6d4b196 100644 --- a/src/core/build/createWebpackConfig.ts +++ b/src/core/build/createWebpackConfig.ts @@ -488,42 +488,5 @@ export default function createWebpackConfig({ }), ], }, - /* Webpack config for our auth */ - { - ...baseConfig, - entry: [ - // No polyfills for the embed. - (isProduction && "") || - require.resolve("react-dev-utils/webpackHotDevClient"), - paths.appAuthIndex, - // Remove deactivated entries. - ].filter(s => s), - output: { - ...baseConfig.output, - library: "Talk", - filename: "assets/js/auth.js", - }, - plugins: [ - ...baseConfig.plugins!, - // Generates an `stream.html` file with the diff --git a/src/core/client/framework/lib/bootstrap/TalkContext.tsx b/src/core/client/framework/lib/bootstrap/TalkContext.tsx index 90ed10530..75ddc974c 100644 --- a/src/core/client/framework/lib/bootstrap/TalkContext.tsx +++ b/src/core/client/framework/lib/bootstrap/TalkContext.tsx @@ -2,6 +2,7 @@ import { LocalizationProvider } from "fluent-react/compat"; import { MessageContext } from "fluent/compat"; import { Child as PymChild } from "pym.js"; import React, { StatelessComponent } from "react"; +import { MediaQueryMatchers } from "react-responsive"; import { Formatter } from "react-timeago"; import { Environment } from "relay-runtime"; @@ -18,6 +19,9 @@ export interface TalkContext { /** formatter for timeago. */ timeagoFormatter?: Formatter; + /** media query values for testing purposes */ + mediaQueryValues?: MediaQueryMatchers; + /** * A way to listen for clicks that are e.g. outside of the * current frame for `ClickOutside` @@ -48,6 +52,7 @@ export const TalkContextProvider: StatelessComponent<{ value={{ timeagoFormatter: value.timeagoFormatter, registerClickFarAway: value.registerClickFarAway, + mediaQueryValues: value.mediaQueryValues, }} > {children} diff --git a/src/core/client/stream/components/App.tsx b/src/core/client/stream/components/App.tsx index 39272cb17..f5f4262f7 100644 --- a/src/core/client/stream/components/App.tsx +++ b/src/core/client/stream/components/App.tsx @@ -2,7 +2,6 @@ import * as React from "react"; import { StatelessComponent } from "react"; import { Flex } from "talk-ui/components"; - import PermalinkViewQuery from "../queries/PermalinkViewQuery"; import StreamQuery from "../queries/StreamQuery"; @@ -23,6 +22,7 @@ const App: StatelessComponent = props => { {view} ); + // return
{view}
; }; export default App; diff --git a/src/core/client/stream/components/Auth.tsx b/src/core/client/stream/components/Auth.tsx deleted file mode 100644 index 04284be43..000000000 --- a/src/core/client/stream/components/Auth.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from "react"; -import { StatelessComponent } from "react"; - -import { Flex, Button, Popup, Typography } from "talk-ui/components"; - -interface AuthProps { - open: boolean; - focus: boolean; - openPopup: () => void; - closePopup: () => void; - setFocus: (focus: boolean) => void; -} - -const Auth: StatelessComponent = props => { - return ( -
- props.setFocus(true)} - onBlur={() => props.setFocus(false)} - onClose={props.closePopup} - /> - - Join the conversation | - - - -
- ); -}; - -export default Auth; diff --git a/src/core/client/stream/components/Comment/Comment.css b/src/core/client/stream/components/Comment/Comment.css index c4bf8c532..5c0f67095 100644 --- a/src/core/client/stream/components/Comment/Comment.css +++ b/src/core/client/stream/components/Comment/Comment.css @@ -1,3 +1,6 @@ +.root { + width: 100%; +} .footer { margin-top: var(--spacing-unit); } diff --git a/src/core/client/stream/components/Comment/Comment.tsx b/src/core/client/stream/components/Comment/Comment.tsx index 932cd7155..b47c8ac02 100644 --- a/src/core/client/stream/components/Comment/Comment.tsx +++ b/src/core/client/stream/components/Comment/Comment.tsx @@ -20,7 +20,7 @@ export interface CommentProps { const Comment: StatelessComponent = props => { return ( -
+
{props.author && props.author.username && {props.author.username}} diff --git a/src/core/client/stream/components/Comment/TopBar.tsx b/src/core/client/stream/components/Comment/TopBar.tsx index 2dfe6419d..a82dd0a28 100644 --- a/src/core/client/stream/components/Comment/TopBar.tsx +++ b/src/core/client/stream/components/Comment/TopBar.tsx @@ -14,7 +14,7 @@ export interface TopBarProps { const TopBar: StatelessComponent = props => { const rootClassName = cn(styles.root, props.className); return ( - + {matches => ( = props => { return ( - + {matches => ( diff --git a/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap b/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap index 6c5348d0b..2e6694137 100644 --- a/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap +++ b/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap @@ -1,9 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly on big screens 1`] = ` -
+
Hello World @@ -13,9 +15,11 @@ exports[`renders correctly on big screens 1`] = ` `; exports[`renders correctly on small screens 1`] = ` -
+
Hello World diff --git a/src/core/client/stream/components/PermalinkButton/PermalinkButton.tsx b/src/core/client/stream/components/PermalinkButton/PermalinkButton.tsx index 493625e2b..ec1be799f 100644 --- a/src/core/client/stream/components/PermalinkButton/PermalinkButton.tsx +++ b/src/core/client/stream/components/PermalinkButton/PermalinkButton.tsx @@ -57,10 +57,10 @@ class Permalink extends React.Component { active={visible} size="small" > - + share - + Share diff --git a/src/core/client/stream/components/PermalinkButton/PermalinkPopover.tsx b/src/core/client/stream/components/PermalinkButton/PermalinkPopover.tsx index 218bd78f6..9e7afcc9d 100644 --- a/src/core/client/stream/components/PermalinkButton/PermalinkPopover.tsx +++ b/src/core/client/stream/components/PermalinkButton/PermalinkPopover.tsx @@ -38,15 +38,19 @@ class PermalinkPopover extends React.Component { const { copied } = this.state; return ( - + + + + + )} + {!comment && ( + + Comment not found + )} - {!comment && Comment not found} {comment && ( diff --git a/src/core/client/stream/components/UserBoxUnauthenticated.tsx b/src/core/client/stream/components/UserBoxUnauthenticated.tsx index 37a22ee0f..323b0acf5 100644 --- a/src/core/client/stream/components/UserBoxUnauthenticated.tsx +++ b/src/core/client/stream/components/UserBoxUnauthenticated.tsx @@ -3,6 +3,7 @@ import React, { StatelessComponent } from "react"; import { Button, Flex, Typography } from "talk-ui/components"; +import MatchMedia from "talk-ui/components/MatchMedia"; import * as styles from "./UserBoxUnauthenticated.css"; export interface UserBoxUnauthenticatedProps { @@ -15,20 +16,27 @@ const UserBoxUnauthenticated: StatelessComponent< > = props => { return ( - - - Join the conversation + + + + Join the conversation + + + + | - - - | - + - diff --git a/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap b/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap index e5b84fc16..9cf950ec6 100644 --- a/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap +++ b/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap @@ -2,23 +2,27 @@ exports[`renders correctly 1`] = ` - + + + Join the conversation + + - Join the conversation + | - - - | - + diff --git a/src/core/client/stream/containers/AuthContainer.tsx b/src/core/client/stream/containers/AuthContainer.tsx deleted file mode 100644 index 688d6627e..000000000 --- a/src/core/client/stream/containers/AuthContainer.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from "react"; - -import Auth from "../components/Auth"; - -class AuthContainer extends React.Component { - state = { - open: false, - focus: false, - }; - - openPopup = () => { - this.setState({ - open: true, - }); - }; - - closePopup = () => { - this.setState({ - open: false, - }); - }; - - setFocus = (focus: boolean) => { - this.setState({ - focus, - }); - }; - - render() { - const { open, focus } = this.state; - return ( - - ); - } -} - -export default AuthContainer; diff --git a/src/core/client/stream/containers/UserBoxContainer.tsx b/src/core/client/stream/containers/UserBoxContainer.tsx index 359c93d97..fca219660 100644 --- a/src/core/client/stream/containers/UserBoxContainer.tsx +++ b/src/core/client/stream/containers/UserBoxContainer.tsx @@ -37,7 +37,7 @@ export class UserBoxContainer extends Component { ( - + ); diff --git a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap index 16b8d5fb6..d3310dc45 100644 --- a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap +++ b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap @@ -1,28 +1,24 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`loads more comments 1`] = ` -
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
+
Show all Comments -
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
+
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
- - Join the conversation - - - | -
-
+
-
+
-
+
-
+
-
+
-
+
{ color?: "regular" | "primary" | "error" | "success"; /** Variant of the button */ - variant?: "regular" | "filled" | "outlined" | "ghost"; + variant?: "regular" | "filled" | "outlined" | "ghost" | "underlined"; /** If set renders a full width button */ fullWidth?: boolean; @@ -72,6 +72,7 @@ export class Button extends React.Component { [classes.variantFilled]: variant === "filled", [classes.variantOutlined]: variant === "outlined", [classes.variantGhost]: variant === "ghost", + [classes.variantUnderlined]: variant === "underlined", [classes.fullWidth]: fullWidth, [classes.active]: active, [classes.disabled]: disabled, diff --git a/src/core/client/ui/components/Flex/Flex.css b/src/core/client/ui/components/Flex/Flex.css index 378b4e9ba..2e6914c7f 100644 --- a/src/core/client/ui/components/Flex/Flex.css +++ b/src/core/client/ui/components/Flex/Flex.css @@ -1,5 +1,10 @@ .root { + width: 100%; +} + +.flex { display: flex; + width: 100%; } .halfItemGutter { @@ -26,6 +31,30 @@ } } +.doubleItemGutter { + & > * { + margin: 0 calc(2 * var(--spacing-unit)) 0 0 !important; + } + &.directionRowReverse { + & > * { + margin: 0 0 0 calc(2 * var(--spacing-unit)) !important; + } + } + &.directionColumn { + & > * { + margin: 0 0 calc(2 * var(--spacing-unit)) 0 !important; + } + } + &.directionColumnReverese { + & > * { + margin: calc(2 * var(--spacing-unit)) 0 0 0 !important; + } + } + & > *:last-child { + margin: 0 !important; + } +} + .itemGutter { & > * { margin: 0 var(--spacing-unit) 0 0 !important; @@ -93,6 +122,23 @@ margin-left: calc(0.5 * var(--spacing-unit)) !important; } } + + &:not(.directionColumn).doubleItemGutter { + &:not(:empty) { + margin-top: calc(-2 * var(--spacing-unit)) !important; + } + & > * { + margin-top: calc(2 * var(--spacing-unit)) !important; + } + } + &.directionColumn.doubleItemGutter { + &:not(:empty) { + margin-left: calc(-2 * var(--spacing-unit)) !important; + } + &.doubleItemGutter > * { + margin-left: calc(2 * var(--spacing-unit)) !important; + } + } } .justifyFlexStart { diff --git a/src/core/client/ui/components/Flex/Flex.mdx b/src/core/client/ui/components/Flex/Flex.mdx index 84eeb8240..7ca59bb54 100644 --- a/src/core/client/ui/components/Flex/Flex.mdx +++ b/src/core/client/ui/components/Flex/Flex.mdx @@ -33,3 +33,29 @@ import Button from '../Button' + +## Item Gutter + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/client/ui/components/Flex/Flex.tsx b/src/core/client/ui/components/Flex/Flex.tsx index c29bd814c..bf66f9084 100644 --- a/src/core/client/ui/components/Flex/Flex.tsx +++ b/src/core/client/ui/components/Flex/Flex.tsx @@ -25,7 +25,7 @@ interface InnerProps { | "space-evenly"; alignItems?: "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; direction?: "row" | "column" | "row-reverse" | "column-reverse"; - itemGutter?: boolean | "half"; + itemGutter?: boolean | "half" | "double"; className?: string; wrap?: boolean | "reverse"; @@ -43,6 +43,7 @@ const Flex: StatelessComponent = props => { itemGutter, wrap, forwardRef, + children, ...rest } = props; @@ -55,6 +56,7 @@ const Flex: StatelessComponent = props => { const classObject: Record = { [classes.itemGutter]: itemGutter === true, [classes.halfItemGutter]: itemGutter === "half", + [classes.doubleItemGutter]: itemGutter === "double", [classes.wrap]: wrap === true, [classes.wrapReverse]: wrap === "reverse", }; @@ -75,12 +77,13 @@ const Flex: StatelessComponent = props => { classObject[(classes as any)[`direction${pascalCase(direction)}`]] = true; } - const classNames: string = cn(classes.root, className, classObject); + const rootClassNames: string = cn(classes.root, className); + const flexClassNames: string = cn(classes.flex, classObject); // The first div is required to support nested `Flex` components with itemGutters. return ( -
-
+
+
{children}
); }; diff --git a/src/core/client/ui/components/Flex/__snapshots__/Flex.spec.tsx.snap b/src/core/client/ui/components/Flex/__snapshots__/Flex.spec.tsx.snap index b1f72d74b..d96f60ebd 100644 --- a/src/core/client/ui/components/Flex/__snapshots__/Flex.spec.tsx.snap +++ b/src/core/client/ui/components/Flex/__snapshots__/Flex.spec.tsx.snap @@ -1,9 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly 1`] = ` -
+
Hello World @@ -13,9 +15,11 @@ exports[`renders correctly 1`] = ` `; exports[`renders with halfe item gutter 1`] = ` -
+
Hello World @@ -25,9 +29,11 @@ exports[`renders with halfe item gutter 1`] = ` `; exports[`renders with item gutter 1`] = ` -
+
Hello World @@ -37,9 +43,11 @@ exports[`renders with item gutter 1`] = ` `; exports[`renders with wrap 1`] = ` -
+
Hello World @@ -49,9 +57,11 @@ exports[`renders with wrap 1`] = ` `; exports[`renders with wrap reverse 1`] = ` -
+
Hello World diff --git a/src/core/client/ui/components/FormField/FormField.css b/src/core/client/ui/components/FormField/FormField.css new file mode 100644 index 000000000..b1521ed5d --- /dev/null +++ b/src/core/client/ui/components/FormField/FormField.css @@ -0,0 +1,14 @@ +.root { + display: flex; + flex-direction: column; + width: 100%; + justify-content: space-between; + + &.halfItemGutter > * { + margin-left: calc(0.5 * var(--spacing-unit)) !important; + } + + &.itemGutter > * { + margin-top: var(--spacing-unit) !important; + } +} diff --git a/src/core/client/ui/components/FormField/FormField.mdx b/src/core/client/ui/components/FormField/FormField.mdx new file mode 100644 index 000000000..3dc055085 --- /dev/null +++ b/src/core/client/ui/components/FormField/FormField.mdx @@ -0,0 +1,36 @@ +--- +name: FormField +menu: UI Kit +--- + +import { Playground, PropsTable } from 'docz' +import FormField from './FormField' +import { InputLabel, ValidationMessage, TextField, Typography, Flex, Button} from '../core/client/ui/components' + +# Flex + +`FormField` is to be used with Form Components `flexbox`. + +## Justify content + + + + + +## Align items + + + + + + + + +## Direction + + + + + + + diff --git a/src/core/client/ui/components/FormField/FormField.tsx b/src/core/client/ui/components/FormField/FormField.tsx new file mode 100644 index 000000000..fe5b6dd7b --- /dev/null +++ b/src/core/client/ui/components/FormField/FormField.tsx @@ -0,0 +1,43 @@ +import cn from "classnames"; +import React, { ReactNode } from "react"; +import { StatelessComponent } from "react"; + +import { withStyles } from "talk-ui/hocs"; + +import * as styles from "./FormField.css"; + +interface InnerProps { + children: ReactNode; + classes: typeof styles; + id?: string; + className?: string; + itemGutter?: boolean | "half"; +} + +const FormField: StatelessComponent = props => { + const { classes, className, children, itemGutter, ...rest } = props; + + // TODO (bc): Use flex component once the extra div issue is solved. + return ( +
+ {children} +
+ ); +}; + +FormField.defaultProps = { + itemGutter: true, +}; + +const enhanced = withStyles(styles)(FormField); +export default enhanced; diff --git a/src/core/client/ui/components/FormField/index.ts b/src/core/client/ui/components/FormField/index.ts new file mode 100644 index 000000000..e2d6f74d4 --- /dev/null +++ b/src/core/client/ui/components/FormField/index.ts @@ -0,0 +1 @@ +export { default } from "./FormField"; diff --git a/src/core/client/ui/components/MatchMedia/MatchMedia.mdx b/src/core/client/ui/components/MatchMedia/MatchMedia.mdx index 3f3186bb6..b9a64a328 100644 --- a/src/core/client/ui/components/MatchMedia/MatchMedia.mdx +++ b/src/core/client/ui/components/MatchMedia/MatchMedia.mdx @@ -12,29 +12,29 @@ import MatchMedia from './MatchMedia' ## Basic usage - + I'm a very small screen - + I'm a small screen - + I'm a medium screen - + I'm a large screen - + I'm a very large screen - + I'm a super large screen ## Using render props - + {matches => {matches ? "I'm big" : "I'm small"}} diff --git a/src/core/client/ui/components/MatchMedia/MatchMedia.spec.tsx b/src/core/client/ui/components/MatchMedia/MatchMedia.spec.tsx index 6f53df511..1b4ded65e 100644 --- a/src/core/client/ui/components/MatchMedia/MatchMedia.spec.tsx +++ b/src/core/client/ui/components/MatchMedia/MatchMedia.spec.tsx @@ -9,8 +9,8 @@ import { default as MatchMediaWithContext, MatchMedia } from "./MatchMedia"; it("renders correctly", () => { const props: PropTypesOf = { - minWidth: "xs", - maxWidth: "sm", + lteWidth: "xs", + gteWidth: "sm", component: "div", screen: true, children:
Hello World
, @@ -19,6 +19,16 @@ it("renders correctly", () => { expect(wrapper).toMatchSnapshot(); }); +it("renders less than and great than correctly", () => { + const props: PropTypesOf = { + ltWidth: "xs", + gtWidth: "sm", + children:
Hello World
, + }; + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); +}); + it("map new speech prop to older aural prop", () => { const props: PropTypesOf = { speech: true, @@ -37,7 +47,7 @@ it("should get mediaQueryValues from context", () => { }; const wrapper = mount( - + Hello World diff --git a/src/core/client/ui/components/MatchMedia/MatchMedia.tsx b/src/core/client/ui/components/MatchMedia/MatchMedia.tsx index 8df6cff34..677e558bc 100644 --- a/src/core/client/ui/components/MatchMedia/MatchMedia.tsx +++ b/src/core/client/ui/components/MatchMedia/MatchMedia.tsx @@ -10,8 +10,17 @@ import UIContext from "../UIContext"; type Breakpoints = keyof typeof theme.breakpoints; interface InnerProps { - minWidth?: Breakpoints; - maxWidth?: Breakpoints; + /** greater than or equal width. */ + gteWidth?: Breakpoints; + + /** greater than width. */ + gtWidth?: Breakpoints; + + /** less than equals width. */ + lteWidth?: Breakpoints; + + /** less than equals width. */ + ltWidth?: Breakpoints; children: ReactNode | ((matches: boolean) => React.ReactNode); className?: string; component?: @@ -27,13 +36,21 @@ interface InnerProps { } export const MatchMedia: StatelessComponent = props => { - const { speech, minWidth, maxWidth, ...rest } = props; + const { speech, gteWidth, gtWidth, lteWidth, ltWidth, ...rest } = props; const mapped = { // TODO: Temporarily map newer speech to older aural type until // react-responsive supports the speech prop. aural: speech, - minWidth: minWidth ? theme.breakpoints[minWidth] + 1 : undefined, - maxWidth: maxWidth ? theme.breakpoints[maxWidth] : undefined, + minWidth: gtWidth + ? theme.breakpoints[gtWidth] + 1 + : gteWidth + ? theme.breakpoints[gteWidth] + : undefined, + maxWidth: ltWidth + ? theme.breakpoints[ltWidth] - 1 + : lteWidth + ? theme.breakpoints[lteWidth] + : undefined, }; return ; }; diff --git a/src/core/client/ui/components/MatchMedia/__snapshots__/MatchMedia.spec.tsx.snap b/src/core/client/ui/components/MatchMedia/__snapshots__/MatchMedia.spec.tsx.snap index a128d4ba0..88670e33f 100644 --- a/src/core/client/ui/components/MatchMedia/__snapshots__/MatchMedia.spec.tsx.snap +++ b/src/core/client/ui/components/MatchMedia/__snapshots__/MatchMedia.spec.tsx.snap @@ -14,8 +14,8 @@ exports[`map new speech prop to older aural prop 1`] = ` exports[`renders correctly 1`] = ` @@ -24,3 +24,15 @@ exports[`renders correctly 1`] = `
`; + +exports[`renders less than and great than correctly 1`] = ` + +
+ Hello World +
+
+`; diff --git a/src/core/client/ui/components/TextField/TextField.css b/src/core/client/ui/components/TextField/TextField.css index 924d6483a..954ce577e 100644 --- a/src/core/client/ui/components/TextField/TextField.css +++ b/src/core/client/ui/components/TextField/TextField.css @@ -5,10 +5,12 @@ padding: calc(0.5 * var(--spacing-unit)); box-sizing: border-box; border-radius: var(--round-corners); + height: 36px; + line-height: 36px; } .colorRegular { - backgroun-color: var(--palette-common-white); + background-color: var(--palette-common-white); color: var(--palette-common-black); border: 1px solid var(--palette-grey-light); } @@ -16,10 +18,18 @@ .colorError { background-color: var(--palette-common-white); border-color: var(--palette-error-main); - border: 2px solid #FA4643; + border: 2px solid var(--palette-error-darkest); } .fullWidth { width: 100%; } +::placeholder { + font-family: var(--font-family); + font-style: normal; + font-weight: normal; + line-height: calc(16rem / var(--rem-base)); + font-size: calc(16rem / var(--rem-base)); + color: var(--palette-grey-lighter); +} diff --git a/src/core/client/ui/components/TextField/TextField.mdx b/src/core/client/ui/components/TextField/TextField.mdx index 82196c778..bbfceb20d 100644 --- a/src/core/client/ui/components/TextField/TextField.mdx +++ b/src/core/client/ui/components/TextField/TextField.mdx @@ -12,6 +12,7 @@ import Flex from '../Flex' ## Basic Use + diff --git a/src/core/client/ui/components/TextField/TextField.tsx b/src/core/client/ui/components/TextField/TextField.tsx index 0383192ce..e3771b2b6 100644 --- a/src/core/client/ui/components/TextField/TextField.tsx +++ b/src/core/client/ui/components/TextField/TextField.tsx @@ -33,6 +33,10 @@ export interface TextFieldProps { * Placeholder */ placeholder?: string; + /** + * readOnly + */ + readOnly?: boolean; } const TextField: StatelessComponent = props => { @@ -68,7 +72,7 @@ const TextField: StatelessComponent = props => { TextField.defaultProps = { color: "regular", - fullWidth: false, + fullWidth: true, placeholder: "", }; diff --git a/src/core/client/ui/components/Typography/Typography.css b/src/core/client/ui/components/Typography/Typography.css index 22d06c2ed..ec86f3c9f 100644 --- a/src/core/client/ui/components/Typography/Typography.css +++ b/src/core/client/ui/components/Typography/Typography.css @@ -39,6 +39,10 @@ composes: inputLabel from "talk-ui/shared/typography.css"; } +.inputDescription { + composes: inputDescription from "talk-ui/shared/typography.css"; +} + .timestamp { composes: timestamp from "talk-ui/shared/typography.css"; } diff --git a/src/core/client/ui/components/Typography/Typography.tsx b/src/core/client/ui/components/Typography/Typography.tsx index 86adf7a54..92474adec 100644 --- a/src/core/client/ui/components/Typography/Typography.tsx +++ b/src/core/client/ui/components/Typography/Typography.tsx @@ -14,6 +14,8 @@ type Variant = | "heading4" | "bodyCopy" | "bodyCopyBold" + | "inputLabel" + | "inputDescription" | "timestamp"; // Based on Typography Component of Material UI. @@ -131,12 +133,10 @@ Typography.defaultProps = { heading3: "h1", heading4: "h1", bodyCopy: "p", -<<<<<<< HEAD - inputLabel: "label", -======= bodyCopyBold: "p", ->>>>>>> ff62dc4ecc00cdcef1a742bc23db032271511f91 timestamp: "span", + inputLabel: "label", + inputDescription: "p", }, noWrap: false, paragraph: false, diff --git a/src/core/client/ui/components/ValidationMessage/ValidationMessage.css b/src/core/client/ui/components/ValidationMessage/ValidationMessage.css index 330281ad4..b3d6a6290 100644 --- a/src/core/client/ui/components/ValidationMessage/ValidationMessage.css +++ b/src/core/client/ui/components/ValidationMessage/ValidationMessage.css @@ -1,5 +1,5 @@ .root { - composes: validationMessage from "talk-ui/shared/typography.css"; + composes: alertMessage from "talk-ui/shared/typography.css"; position: relative; display: inline-flex; justify-content: flex-start; diff --git a/src/core/client/ui/components/ValidationMessage/ValidationMessage.spec.tsx b/src/core/client/ui/components/ValidationMessage/ValidationMessage.spec.tsx index ddd3d343e..f336fb06e 100644 --- a/src/core/client/ui/components/ValidationMessage/ValidationMessage.spec.tsx +++ b/src/core/client/ui/components/ValidationMessage/ValidationMessage.spec.tsx @@ -8,7 +8,6 @@ import ValidationMessage from "./ValidationMessage"; it("renders correctly", () => { const props: PropTypesOf = { className: "custom", - color: "error", children: "Hello World", }; const renderer = TestRenderer.create(); diff --git a/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap b/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap index b26303e81..2a80be622 100644 --- a/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap +++ b/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap @@ -3,7 +3,6 @@ exports[`renders correctly 1`] = `
- + Sign up to join the conversation - Email Address - - Username - A unique identifier displayed on your comments. You may use “_” and “.” - - Password - Must be at least 8 characters - - Confirm Password - - + + + Email Address + + + + + Username + A unique identifier displayed on your comments. You may use “_” and “.” + + + + + + Password + Must be at least 8 characters + + + + + Confirm Password + + + + ## Simple Form with error + - + Sign up to join the conversation - Email Address - - Username - A unique identifier displayed on your comments. You may use “_” and “.” - - Invalid characters. Try again. - Password - Must be at least 8 characters - - Confirm Password - - + + + Email Address + + + + + Username + A unique identifier displayed on your comments. You may use “_” and “.” + + Invalid characters. Try again. + + + + + Password + Must be at least 8 characters + + + + + Confirm Password + + + + diff --git a/src/locales/en-US/stream.ftl b/src/locales/en-US/stream.ftl index 7d018f80f..01a2ed331 100644 --- a/src/locales/en-US/stream.ftl +++ b/src/locales/en-US/stream.ftl @@ -6,9 +6,11 @@ comments-postCommentForm-post = Post comments-stream-loadMore = Load more comments-replyList-showAll = Show all -comments-permalink-share = Share -comments-permalink-copy = Copy -comments-permalink-copied = Copied +comments-permalinkButton-share = Share +comments-permalinkPopover-copy = Copy +comments-permalinkPopover-copied = Copied +comments-permalinkView-showAllComments = Show all comments +comments-permalinkView-commentNotFound = Comment not found comments-userBoxUnauthenticated-joinTheConversation = Join the conversation comments-userBoxUnauthenticated-signIn = Sign in