Skip to content

Commit

Permalink
restructure repo for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
dohomi committed Apr 17, 2023
1 parent 3b7d460 commit 81ab83c
Show file tree
Hide file tree
Showing 111 changed files with 886 additions and 463 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ graphql.config.*
.graphqlconfig
schema.graphql
.tamagui
.turbo
.turbo
dist

**/types/**/*.d.ts.map
10 changes: 0 additions & 10 deletions packages/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,3 @@ dist/
THUMBS_DB
node_modules/
types/
*.d.ts
*.d.ts.map
youtube/**/*.ts
video/**/*.ts
richText/**/*.ts
link/**/*.ts
form/**/*.ts
file/**/*.ts
date/**/*.ts
core/**/*.ts
2 changes: 2 additions & 0 deletions packages/core/src/core/hooks/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './usePopoverState';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/hooks/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/core/src/core/hooks/usePopoverState.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="react" />
export declare const usePopoverState: (defaultOpen?: boolean) => {
open: boolean;
onOpenChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
defaultOpen: boolean;
};
//# sourceMappingURL=usePopoverState.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/hooks/usePopoverState.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions packages/core/src/core/panels/LmDialog.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { DialogProps, SizeTokens } from 'tamagui';
import { ReactNode } from 'react';
import { LmDialogActions } from './LmDialogActions';
import { LmDialogContent } from './LmDialogContent';
type LmDialogProps = DialogProps & {
trigger?: ReactNode;
title?: string;
description?: string;
hideCloseButton?: boolean;
fullScreen?: boolean;
contentPadding?: SizeTokens;
dialogHeight?: string | number;
dialogWidth?: string | number;
};
export declare function LmDialog({ children, trigger, title, description, hideCloseButton, fullScreen, contentPadding, dialogWidth, dialogHeight, ...dialogProps }: LmDialogProps): JSX.Element;
export declare namespace LmDialog {
var Actions: typeof LmDialogActions;
var Content: typeof LmDialogContent;
}
export {};
//# sourceMappingURL=LmDialog.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/LmDialog.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/core/src/core/panels/LmDialogActions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="react" />
import { SizeTokens, XStackProps } from 'tamagui';
export type LmDialogActionsProps = XStackProps & {
contentPadding?: SizeTokens;
};
export declare function LmDialogActions({ children, contentPadding, ...rest }: LmDialogActionsProps): JSX.Element;
//# sourceMappingURL=LmDialogActions.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/LmDialogActions.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/core/src/core/panels/LmDialogContent.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="react" />
import { SizeTokens, YStackProps } from 'tamagui';
export type LmDialogContentProps = YStackProps & {
contentPadding?: SizeTokens;
};
export declare function LmDialogContent({ children, contentPadding, ...rest }: LmDialogContentProps): JSX.Element;
//# sourceMappingURL=LmDialogContent.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/LmDialogContent.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/core/src/core/panels/LmPopover.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { PopoverContentProps, PopoverProps } from 'tamagui';
import { ReactNode } from 'react';
import { LmSheetProps } from './LmSheet';
export type LmPopoverProps = PopoverProps & {
trigger?: ReactNode;
hideArrow?: boolean;
contentProps?: PopoverContentProps;
isBouncy?: boolean;
sheetProps?: LmSheetProps;
};
export declare function LmPopover({ trigger, children, hideArrow, contentProps, isBouncy, sheetProps, ...popoverProps }: LmPopoverProps): JSX.Element;
//# sourceMappingURL=LmPopover.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/LmPopover.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/core/src/core/panels/LmSheet.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ScrollViewProps } from 'tamagui';
import { PropsWithChildren } from 'react';
import { SheetProps } from '@tamagui/sheet/src/types';
export type LmSheetProps = PropsWithChildren<SheetProps & {
hideHandle?: boolean;
fullScreen?: boolean;
enableScroll?: boolean;
scrollviewProps?: ScrollViewProps;
}>;
export declare function LmSheet({ hideHandle, children, fullScreen, snapPoints, enableScroll, scrollviewProps, ...sheetProps }: LmSheetProps): JSX.Element;
//# sourceMappingURL=LmSheet.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/LmSheet.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/core/src/core/panels/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './LmPopover';
export * from './LmDialog';
export * from './LmSheet';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions packages/core/src/core/panels/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/date/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
.DS_Store
THUMBS_DB
node_modules/
types/
2 changes: 2 additions & 0 deletions packages/date/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@tamagui-extras/date",
"license": "MIT",
"version": "0.17.0",
"author": "Dominic Garms",
"repository": "/~https://github.com/dohomi/tamagui-kitchen-sink",
"homepage": "https://tamagui-extras.vercel.app",
Expand Down Expand Up @@ -39,6 +40,7 @@
"dependencies": {
"@datepicker-react/hooks": "^2.8.4",
"@react-native-community/datetimepicker": "^7.0.1",
"@tamagui-extras/form": "*",
"react-hook-form": "^7.43.9",
"react-native-modal-datetime-picker": "^15.0.0"
},
Expand Down
194 changes: 97 additions & 97 deletions packages/date/src/datepicker/LmDatepicker.native.tsx
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
import DateTimePickerModal from 'react-native-modal-datetime-picker'
import {LmDatepickerProps} from './datepickerTypes'
import {LmFormFieldContainer} from '../../../core/src/form'
import {useId, useState} from 'react'
import {Button, Input, XGroup, XStack} from 'tamagui'
import {Platform} from 'react-native'
import {getLocaleDate} from '../dateHelper'
import {Calendar} from 'tamagui-phosphor-icons'
import {OnDatesChangeProps, START_DATE} from '@datepicker-react/hooks'
import { LmDatepickerProps } from './datepickerTypes'
import { LmFormFieldContainer } from '@tamagui-extras/form'
import { useId, useState } from 'react'
import { Button, Input, XGroup, XStack } from 'tamagui'
import { Platform } from 'react-native'
import { getLocaleDate } from '../dateHelper'
import { Calendar } from 'tamagui-phosphor-icons'
import { OnDatesChangeProps, START_DATE } from '@datepicker-react/hooks'

export function LmDatepicker({
numberOfMonths,
isRangePicker,
onChange,
labelFunctions,
startDate = null,
endDate = null,
required,
error,
helperText,
label,
labelProps,
labelInline,
}: LmDatepickerProps) {
const id = useId()
const [startOpen, startOpenChange] = useState(false)
const [endOpen, endOpenChange] = useState(false)
const [state, setState] = useState<OnDatesChangeProps>({
startDate: startDate,
endDate: endDate,
focusedInput: START_DATE,
})
return (
<LmFormFieldContainer
id={id}
error={error}
required={required}
labelProps={labelProps}
label={label}
labelInline={labelInline}
helperText={helperText}
>
<XStack space width={Platform.OS === 'web' ? 'fit-content' : undefined}>
<XGroup>
<XGroup.Item>
<Input
width={'$12'}
value={state.startDate ? getLocaleDate({date: state.startDate}) : ''}
></Input>
</XGroup.Item>
<XGroup.Item>
<Button onPress={() => startOpenChange((state) => !state)} icon={<Calendar/>}/>
</XGroup.Item>
</XGroup>
{isRangePicker && (
<XGroup>
<XGroup.Item>
<Input
width={'$12'}
value={state.endDate ? getLocaleDate({date: state.endDate}) : ''}
/>
</XGroup.Item>
<XGroup.Item>
<Button onPress={() => endOpenChange((state) => !state)} icon={<Calendar/>}/>
</XGroup.Item>
</XGroup>
)}
</XStack>
{startOpen && (
<DateTimePickerModal
date={state.startDate ?? undefined}
isVisible={startOpen}
mode={'date'}
onConfirm={(date) => {
setState((old) => ({
...old,
startDate: date ?? null,
}))
startOpenChange(false)
}}
onCancel={() => startOpenChange(false)}
/>
)}
{endOpen && (
<DateTimePickerModal
date={state.endDate ?? undefined}
isVisible={endOpen}
mode={'date'}
onConfirm={(date) => {
setState((old) => ({
...old,
endDate: date ?? null,
}))
startOpenChange(false)
}}
onCancel={() => endOpenChange(false)}
/>
)}
</LmFormFieldContainer>
)
numberOfMonths,
isRangePicker,
onChange,
labelFunctions,
startDate = null,
endDate = null,
required,
error,
helperText,
label,
labelProps,
labelInline,
}: LmDatepickerProps) {
const id = useId()
const [startOpen, startOpenChange] = useState(false)
const [endOpen, endOpenChange] = useState(false)
const [state, setState] = useState<OnDatesChangeProps>({
startDate: startDate,
endDate: endDate,
focusedInput: START_DATE,
})
return (
<LmFormFieldContainer
id={id}
error={error}
required={required}
labelProps={labelProps}
label={label}
labelInline={labelInline}
helperText={helperText}
>
<XStack space width={Platform.OS === 'web' ? 'fit-content' : undefined}>
<XGroup>
<XGroup.Item>
<Input
width={'$12'}
value={state.startDate ? getLocaleDate({ date: state.startDate }) : ''}
></Input>
</XGroup.Item>
<XGroup.Item>
<Button onPress={() => startOpenChange((state) => !state)} icon={<Calendar />} />
</XGroup.Item>
</XGroup>
{isRangePicker && (
<XGroup>
<XGroup.Item>
<Input
width={'$12'}
value={state.endDate ? getLocaleDate({ date: state.endDate }) : ''}
/>
</XGroup.Item>
<XGroup.Item>
<Button onPress={() => endOpenChange((state) => !state)} icon={<Calendar />} />
</XGroup.Item>
</XGroup>
)}
</XStack>
{startOpen && (
<DateTimePickerModal
date={state.startDate ?? undefined}
isVisible={startOpen}
mode={'date'}
onConfirm={(date) => {
setState((old) => ({
...old,
startDate: date ?? null,
}))
startOpenChange(false)
}}
onCancel={() => startOpenChange(false)}
/>
)}
{endOpen && (
<DateTimePickerModal
date={state.endDate ?? undefined}
isVisible={endOpen}
mode={'date'}
onConfirm={(date) => {
setState((old) => ({
...old,
endDate: date ?? null,
}))
startOpenChange(false)
}}
onCancel={() => endOpenChange(false)}
/>
)}
</LmFormFieldContainer>
)
}
Loading

0 comments on commit 81ab83c

Please sign in to comment.