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

build: release v1.13.0 #573

Merged
merged 3 commits into from
Nov 23, 2023
Merged
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
5 changes: 4 additions & 1 deletion react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.12.0](https://github.com/opengovsg/design-system/compare/v1.10.0...v1.12.0)
#### [v1.13.0](https://github.com/opengovsg/design-system/compare/v1.10.0...v1.13.0)

- fix: allow correct toggling of datepicker/daterangepicker with calendar button [`#572`](https://github.com/opengovsg/design-system/pull/572)
- chore: merge v1.12.0 back to main [`#571`](https://github.com/opengovsg/design-system/pull/571)
- build: release v1.12.0 [`#570`](https://github.com/opengovsg/design-system/pull/570)
- chore: merge v1.11.0 back to main [`#568`](https://github.com/opengovsg/design-system/pull/568)
- fix: date picker mobile custom input [`#569`](https://github.com/opengovsg/design-system/pull/569)
- build: release v1.11.0 [`#567`](https://github.com/opengovsg/design-system/pull/567)
Expand Down
4 changes: 2 additions & 2 deletions react/package-lock.json

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

2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opengovsg/design-system-react",
"version": "1.12.0",
"version": "1.13.0",
"description": "React components",
"homepage": "https://github.com/opengovsg/design-system/react#readme",
"bugs": "https://github.com/opengovsg/design-system/issues",
Expand Down
1 change: 1 addition & 0 deletions react/src/DatePicker/components/CalendarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const CalendarButton = (): JSX.Element => {
<IconButton
data-group
size={size}
sx={styles.calendarButton}
aria-invalid={isInvalid}
onClick={onOpen}
variant="inputAttached"
Expand Down
22 changes: 22 additions & 0 deletions react/src/DatePicker/components/DatePickerOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Box } from '@chakra-ui/react'

import { useDatePicker } from '../DatePickerContext'

export const DatePickerOverlay = () => {
const {
disclosureProps: { isOpen },
} = useDatePicker()

return (
<Box
position="fixed"
left="0px"
top="0px"
width="100vw"
height="$100vh"
display={isOpen ? 'block' : 'none'}
aria-hidden
bg="transparent"
/>
)
}
2 changes: 2 additions & 0 deletions react/src/DatePicker/components/DatePickerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Flex, Popover, PopoverAnchor } from '@chakra-ui/react'
import { useDatePicker } from '../DatePickerContext'

import { DatePickerInput } from './DatePickerInput'
import { DatePickerOverlay } from './DatePickerOverlay'

export const DatePickerWrapper = ({ children }: PropsWithChildren) => {
const {
Expand Down Expand Up @@ -40,6 +41,7 @@ export const DatePickerWrapper = ({ children }: PropsWithChildren) => {
<PopoverAnchor>{inputToRender}</PopoverAnchor>
{children}
</Popover>
<DatePickerOverlay />
</Flex>
)
}
1 change: 1 addition & 0 deletions react/src/DateRangePicker/components/CalendarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const CalendarButton = (): JSX.Element => {
aria-invalid={isInvalid}
onClick={onOpen}
variant="inputAttached"
sx={styles.calendarButton}
aria-label={calendarButtonAria}
icon={<Icon as={BxCalendar} sx={styles.inputButton} />}
isActive={isOpen}
Expand Down
23 changes: 23 additions & 0 deletions react/src/DateRangePicker/components/DateRangePickerOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Box } from '@chakra-ui/react'

import { useDateRangePicker } from '../DateRangePickerContext'

export const DateRangePickerOverlay = () => {
const {
disclosureProps: { isOpen },
} = useDateRangePicker()

return (
<Box
position="fixed"
left="0px"
top="0px"
width="100vw"
height="$100vh"
display={isOpen ? 'block' : 'none'}
aria-hidden
bg="transparent"
zIndex={1}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Flex, forwardRef, Popover, PopoverAnchor } from '@chakra-ui/react'
import { useDateRangePicker } from '../DateRangePickerContext'

import { DateRangePickerInput } from './DateRangePickerInput'
import { DateRangePickerOverlay } from './DateRangePickerOverlay'

// eslint-disable-next-line @typescript-eslint/ban-types
export const DateRangePickerWrapper = forwardRef<{}, 'input'>(
Expand Down Expand Up @@ -58,6 +59,7 @@ export const DateRangePickerWrapper = forwardRef<{}, 'input'>(
</PopoverAnchor>
{children}
</Popover>
<DateRangePickerOverlay />
</Flex>
)
},
Expand Down
12 changes: 12 additions & 0 deletions react/src/theme/components/DatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const datepickerAnatomy = anatomy('datepicker').parts(
'header',
'inputButton',
'container',
'calendarButton',
)
const { defineMultiStyleConfig, definePartsStyle } =
createMultiStyleConfigHelpers(datepickerAnatomy.keys)
Expand Down Expand Up @@ -34,6 +35,17 @@ export const DatePicker = defineMultiStyleConfig({
container: {
bg: 'utility.ui',
},
calendarButton: {
_active: {
zIndex: '1',
borderColor: 'utility.focus-default',
bg: 'interaction.muted.main.hover',
boxShadow: 'none',
_disabled: {
bg: 'interaction.support.disabled',
},
},
},
header: {
h: '3.5rem',
display: 'flex',
Expand Down
Loading