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

New component library based on ALF #2459

Merged
merged 69 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6ee1aed
Install on native as well
estrattonbailey Jan 9, 2024
3e05502
Add button and link components
estrattonbailey Jan 9, 2024
88b1345
Comments
estrattonbailey Jan 9, 2024
b5474eb
Use new prop
estrattonbailey Jan 9, 2024
83876b6
Add some form elements
estrattonbailey Jan 9, 2024
40446a1
Add labels to input
estrattonbailey Jan 9, 2024
214254b
Fix line height, add suffix
estrattonbailey Jan 10, 2024
1ea20b3
Date inputs
estrattonbailey Jan 10, 2024
0c8c37b
Autofill styles
estrattonbailey Jan 10, 2024
24074de
Clean up InputDate types
estrattonbailey Jan 10, 2024
9bd19a6
Improve types for InputText, value handling
estrattonbailey Jan 10, 2024
22f0c16
Enforce a11y props on buttons
estrattonbailey Jan 10, 2024
2bac965
Add Dialog, Portal
estrattonbailey Jan 10, 2024
78a0f65
Dialog contents
estrattonbailey Jan 10, 2024
ad6d9c4
Native dialog
estrattonbailey Jan 11, 2024
1da54e5
Clean up
estrattonbailey Jan 11, 2024
c100f04
Fix animations
estrattonbailey Jan 11, 2024
bf1641d
Improvements to web modal, exiting still broken
estrattonbailey Jan 11, 2024
0987450
Clean up dialog types
estrattonbailey Jan 11, 2024
b6b6c70
Add Prompt, Dialog refinement, mobile refinement
estrattonbailey Jan 12, 2024
e85df54
Integrate new design tokens, reorg storybook
estrattonbailey Jan 12, 2024
a33fa45
Button colors
estrattonbailey Jan 12, 2024
45c807b
Dim mode
estrattonbailey Jan 12, 2024
ceef550
Reorg
estrattonbailey Jan 13, 2024
1e9c44f
Some styles
estrattonbailey Jan 13, 2024
541e625
Toggles
estrattonbailey Jan 13, 2024
cb1bfe0
Improve a11y
estrattonbailey Jan 14, 2024
4f71e4e
Autosize dialog, handle max height, Dialog.ScrolLView not working
estrattonbailey Jan 14, 2024
94d31d4
Try to use BottomSheet's own APIs
estrattonbailey Jan 15, 2024
048ce02
Scrollable dialogs
estrattonbailey Jan 15, 2024
3df9e7a
Add web shadow
estrattonbailey Jan 15, 2024
4285808
Handle overscroll
estrattonbailey Jan 15, 2024
48abb5a
Styles
estrattonbailey Jan 15, 2024
4d3128a
Dialog text input
estrattonbailey Jan 15, 2024
5e832f3
Shadows
estrattonbailey Jan 16, 2024
e7d9ce6
Button focus states
estrattonbailey Jan 16, 2024
4bf30a1
Button pressed states
estrattonbailey Jan 16, 2024
56a139e
Gradient poc
estrattonbailey Jan 16, 2024
ce049f1
Gradient colors and hovers
estrattonbailey Jan 16, 2024
1e02cde
Add hrefAttrs to Link
estrattonbailey Jan 16, 2024
7315b0d
Some more a11y
estrattonbailey Jan 16, 2024
4c76e38
Toggle invalid states
estrattonbailey Jan 16, 2024
7c2b586
Update dialog descriptions for demo
estrattonbailey Jan 16, 2024
2d80844
Icons
estrattonbailey Jan 16, 2024
1467aa6
Merge remote-tracking branch 'origin/main' into eric/alf
estrattonbailey Jan 16, 2024
0fc5750
WIP Toggle cleanup
estrattonbailey Jan 17, 2024
f520214
Refactor toggle to not rely on immediate children
estrattonbailey Jan 17, 2024
9a22c39
Make Toggle controlled
estrattonbailey Jan 17, 2024
d3d329d
Clean up Toggles storybook
estrattonbailey Jan 17, 2024
6230479
ToggleButton styles
estrattonbailey Jan 17, 2024
449c29b
Improve a11y labels
estrattonbailey Jan 17, 2024
d76ca60
ToggleButton hover darkmode
estrattonbailey Jan 17, 2024
13409f8
Some i18n
estrattonbailey Jan 17, 2024
1e5f213
Refactor input
estrattonbailey Jan 18, 2024
43dc774
Allow extension of input
estrattonbailey Jan 18, 2024
7faaf19
Remove old input
estrattonbailey Jan 18, 2024
fb2e366
Improve icons, add CalendarDays
estrattonbailey Jan 18, 2024
ead02d7
Refactor DateField, web done
estrattonbailey Jan 18, 2024
8a5e188
Add label example
estrattonbailey Jan 18, 2024
175466a
Clean up old InputDate, DateField android, text area example
estrattonbailey Jan 18, 2024
1514ffd
Consistent imports
estrattonbailey Jan 18, 2024
d6925a0
Button context, icons
estrattonbailey Jan 18, 2024
6d3f19c
Add todo
estrattonbailey Jan 18, 2024
83c2b20
Add closeAllDialogs control
estrattonbailey Jan 18, 2024
34c9eec
Alignment
estrattonbailey Jan 18, 2024
8532e81
Expand color palette
estrattonbailey Jan 19, 2024
3ce125c
Hitslops, add shortcut to Storybook in dev
estrattonbailey Jan 19, 2024
4ea40db
Fix multiline on ios
estrattonbailey Jan 19, 2024
462c70a
Mark dialog close button as unused
estrattonbailey Jan 19, 2024
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 assets/icons/arrowTopRight_stoke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/calendarDays_stroke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/colorPalette_stroke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/globe_stroke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions bskyweb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@
height: calc(100% + env(safe-area-inset-top));
}

/* Remove autofill styles on Webkit */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
border: 0;
-webkit-text-fill-color: transparent;
-webkit-box-shadow: none;
}
/* Force left-align date/time inputs on iOS mobile */
input::-webkit-date-and-time-value {
text-align: left;
}

/* Color theming */
:root {
--text: black;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@segment/analytics-react-native": "^2.10.1",
"@segment/sovran-react-native": "^0.4.5",
"@sentry/react-native": "5.5.0",
"@tamagui/focus-scope": "^1.84.1",
"@tanstack/react-query": "^5.8.1",
"@tiptap/core": "^2.0.0-beta.220",
"@tiptap/extension-document": "^2.0.0-beta.220",
Expand Down
59 changes: 35 additions & 24 deletions src/App.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {

import 'view/icons'

import {ThemeProvider as Alf} from '#/alf'
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {init as initPersistedState} from '#/state/persisted'
import {listenSessionDropped} from './state/events'
import {useColorMode} from 'state/shell'
Expand All @@ -25,6 +27,7 @@ import {queryClient} from 'lib/react-query'
import {TestCtrls} from 'view/com/testing/TestCtrls'
import {Provider as ShellStateProvider} from 'state/shell'
import {Provider as ModalStateProvider} from 'state/modals'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as MutedThreadsProvider} from 'state/muted-threads'
import {Provider as InvitesStateProvider} from 'state/invites'
Expand All @@ -39,6 +42,7 @@ import {
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
import * as persisted from '#/state/persisted'
import {Splash} from '#/Splash'
import {Provider as PortalProvider} from '#/components/Portal'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'

Expand All @@ -48,6 +52,7 @@ function InnerApp() {
const colorMode = useColorMode()
const {isInitialLoad, currentAccount} = useSession()
const {resumeSession} = useSessionApi()
const theme = useColorModeTheme(colorMode)
const {_} = useLingui()

// init
Expand All @@ -63,25 +68,27 @@ function InnerApp() {

return (
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
<Splash isReady={!isInitialLoad}>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<LoggedOutViewProvider>
<UnreadNotifsProvider>
<ThemeProvider theme={colorMode}>
{/* All components should be within this provider */}
<RootSiblingParent>
<GestureHandlerRootView style={s.h100pct}>
<TestCtrls />
<Shell />
</GestureHandlerRootView>
</RootSiblingParent>
</ThemeProvider>
</UnreadNotifsProvider>
</LoggedOutViewProvider>
</React.Fragment>
</Splash>
<Alf theme={theme}>
<Splash isReady={!isInitialLoad}>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<LoggedOutViewProvider>
<UnreadNotifsProvider>
<ThemeProvider theme={colorMode}>
{/* All components should be within this provider */}
<RootSiblingParent>
<GestureHandlerRootView style={s.h100pct}>
<TestCtrls />
<Shell />
</GestureHandlerRootView>
</RootSiblingParent>
</ThemeProvider>
</UnreadNotifsProvider>
</LoggedOutViewProvider>
</React.Fragment>
</Splash>
</Alf>
</SafeAreaProvider>
)
}
Expand Down Expand Up @@ -109,11 +116,15 @@ function App() {
<MutedThreadsProvider>
<InvitesStateProvider>
<ModalStateProvider>
<LightboxStateProvider>
<I18nProvider>
<InnerApp />
</I18nProvider>
</LightboxStateProvider>
<DialogStateProvider>
<LightboxStateProvider>
<I18nProvider>
<PortalProvider>
<InnerApp />
</PortalProvider>
</I18nProvider>
</LightboxStateProvider>
</DialogStateProvider>
</ModalStateProvider>
</InvitesStateProvider>
</MutedThreadsProvider>
Expand Down
18 changes: 12 additions & 6 deletions src/App.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {RootSiblingParent} from 'react-native-root-siblings'
import 'view/icons'

import {ThemeProvider as Alf} from '#/alf'
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {init as initPersistedState} from '#/state/persisted'
import {useColorMode} from 'state/shell'
import {Shell} from 'view/shell/index'
Expand All @@ -16,6 +17,7 @@ import {ThemeProvider} from 'lib/ThemeContext'
import {queryClient} from 'lib/react-query'
import {Provider as ShellStateProvider} from 'state/shell'
import {Provider as ModalStateProvider} from 'state/modals'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as MutedThreadsProvider} from 'state/muted-threads'
import {Provider as InvitesStateProvider} from 'state/invites'
Expand All @@ -29,7 +31,7 @@ import {
} from 'state/session'
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
import * as persisted from '#/state/persisted'
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {Provider as PortalProvider} from '#/components/Portal'

function InnerApp() {
const {isInitialLoad, currentAccount} = useSession()
Expand Down Expand Up @@ -92,11 +94,15 @@ function App() {
<MutedThreadsProvider>
<InvitesStateProvider>
<ModalStateProvider>
<LightboxStateProvider>
<I18nProvider>
<InnerApp />
</I18nProvider>
</LightboxStateProvider>
<DialogStateProvider>
<LightboxStateProvider>
<I18nProvider>
<PortalProvider>
<InnerApp />
</PortalProvider>
</I18nProvider>
</LightboxStateProvider>
</DialogStateProvider>
</ModalStateProvider>
</InvitesStateProvider>
</MutedThreadsProvider>
Expand Down
6 changes: 3 additions & 3 deletions src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import {ProfileListScreen} from './view/screens/ProfileList'
import {PostThreadScreen} from './view/screens/PostThread'
import {PostLikedByScreen} from './view/screens/PostLikedBy'
import {PostRepostedByScreen} from './view/screens/PostRepostedBy'
import {DebugScreen} from './view/screens/DebugNew'
import {Storybook} from './view/screens/Storybook'
import {LogScreen} from './view/screens/Log'
import {SupportScreen} from './view/screens/Support'
import {PrivacyPolicyScreen} from './view/screens/PrivacyPolicy'
Expand Down Expand Up @@ -200,8 +200,8 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
/>
<Stack.Screen
name="Debug"
getComponent={() => DebugScreen}
options={{title: title(msg`Debug`), requireAuth: true}}
getComponent={() => Storybook}
options={{title: title(msg`Storybook`), requireAuth: true}}
/>
<Stack.Screen
name="Log"
Expand Down
Loading