Skip to content

Commit

Permalink
Merge pull request #746 from opengovsg/release-v1.23.0
Browse files Browse the repository at this point in the history
build: release v1.23.0
  • Loading branch information
karrui authored Aug 20, 2024
2 parents 2cd0113 + 224b03c commit b43b610
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 10 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/publish-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- beta
- latest

permissions:
id-token: write
packages: write

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -26,10 +30,17 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "16.x"
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish --tag ${{ github.ref_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: "https://npm.pkg.github.com/"
- run: npm publish --tag ${{ github.ref_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 18 additions & 2 deletions react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,37 @@ 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.22.0](https://github.com/opengovsg/design-system/compare/v1.20.0...v1.22.0)
#### [v1.23.0](https://github.com/opengovsg/design-system/compare/v1.22.0...v1.23.0)

- fix!(DatePicker): add `renderInputElement` prop [`#745`](https://github.com/opengovsg/design-system/pull/745)
- chore: enable dual publish to GitHub [`#740`](https://github.com/opengovsg/design-system/pull/740)
- chore: merge latest v1.22.0 back to main [`#732`](https://github.com/opengovsg/design-system/pull/732)
- build: release v1.22.0 [`#731`](https://github.com/opengovsg/design-system/pull/731)

#### [v1.22.0](https://github.com/opengovsg/design-system/compare/v1.21.0...v1.22.0)

> 16 July 2024
- feat: update design tokens to latest push [`#679`](https://github.com/opengovsg/design-system/pull/679)
- chore(deps-dev): bump ws from 8.16.0 to 8.17.1 in /react [`#726`](https://github.com/opengovsg/design-system/pull/726)
- chore(deps-dev): bump husky from 8.0.3 to 9.0.11 [`#659`](https://github.com/opengovsg/design-system/pull/659)
- fix(deps): bump @chakra-ui/react and dependencies to latest versions [`#669`](https://github.com/opengovsg/design-system/pull/669)
- chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /react [`#724`](https://github.com/opengovsg/design-system/pull/724)
- chore: merge latest back to main [`#723`](https://github.com/opengovsg/design-system/pull/723)
- build: release v1.22.0 [`ade85d5`](https://github.com/opengovsg/design-system/commit/ade85d58ba3115f9aa08c4cf4c1110e8a10881a0)
- Merge pull request #722 from opengovsg/fix/reset-date-range-picker [`e86a3ec`](https://github.com/opengovsg/design-system/commit/e86a3ec01f32a5b8d34861bf3beae6f83c253de2)
- fix/reset-date-range-picker [`afff026`](https://github.com/opengovsg/design-system/commit/afff0260629a02feae2203feb41199d81118ded0)

#### [v1.21.0](https://github.com/opengovsg/design-system/compare/v1.20.0...v1.21.0)

> 16 July 2024
- build: release v1.21.0 [`#718`](https://github.com/opengovsg/design-system/pull/718)
- feat: allow users to specify tag input string separator [`#717`](https://github.com/opengovsg/design-system/pull/717)
- chore(deps-dev): bump ejs from 3.1.9 to 3.1.10 in /react [`#711`](https://github.com/opengovsg/design-system/pull/711)
- chore(deps-dev): bump vite from 4.5.2 to 4.5.3 in /react [`#701`](https://github.com/opengovsg/design-system/pull/701)
- chore: merge v1.20.0 back to main [`#700`](https://github.com/opengovsg/design-system/pull/700)
- build: release v1.20.0 [`#699`](https://github.com/opengovsg/design-system/pull/699)
- Merge pull request #722 from opengovsg/fix/reset-date-range-picker [`e86a3ec`](https://github.com/opengovsg/design-system/commit/e86a3ec01f32a5b8d34861bf3beae6f83c253de2)
- build: update version to v1.21.0 [`b171833`](https://github.com/opengovsg/design-system/commit/b1718330d74e098493e23ed339bb93bf6ee6bcf2)
- feat: fix package version [`3bf93d7`](https://github.com/opengovsg/design-system/commit/3bf93d74e1075010bc850d51e0cc3c53cf0ebe64)

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.22.0",
"version": "1.23.0",
"description": "React components",
"homepage": "https://github.com/opengovsg/design-system/react#readme",
"bugs": "https://github.com/opengovsg/design-system/issues",
Expand Down
4 changes: 2 additions & 2 deletions react/src/DatePicker/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ const CustomInputButton = forwardRef<object, 'button'>((_props, ref) => {

export const CustomInput = Template.bind({})
CustomInput.args = {
inputElement: <CustomInputButton />,
renderInputElement: () => <CustomInputButton />,
}

export const MobileCustomInput = Template.bind({})
MobileCustomInput.args = {
inputElement: <CustomInputButton />,
renderInputElement: () => <CustomInputButton />,
}
MobileCustomInput.parameters = getMobileViewParameters()

Expand Down
3 changes: 3 additions & 0 deletions react/src/DatePicker/DatePickerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface DatePickerContextReturn {
colorScheme?: ThemingProps<'DatePicker'>['colorScheme']
size?: ThemingProps<'DatePicker'>['size']
disclosureProps: UseDisclosureReturn
renderInputElement?: () => React.ReactNode
inputElement?: React.ReactNode
innerRef?: React.Ref<HTMLElement>
calendarProps: Pick<
Expand Down Expand Up @@ -114,6 +115,7 @@ const useProvideDatePicker = ({
size,
experimental_forceIosNumberKeyboard,
inputElement,
renderInputElement,
innerRef,
...props
}: DatePickerProviderProps): DatePickerContextReturn => {
Expand Down Expand Up @@ -287,6 +289,7 @@ const useProvideDatePicker = ({
calendarProps,
inputPattern,
inputElement,
renderInputElement,
innerRef,
}
}
5 changes: 3 additions & 2 deletions react/src/DatePicker/components/DatePickerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export const DatePickerWrapper = ({ children }: PropsWithChildren) => {
initialFocusRef,
closeCalendarOnChange,
isMobile,
renderInputElement,
inputElement,
} = useDatePicker()

const inputToRender = useMemo(() => {
return inputElement ?? <DatePickerInput />
}, [inputElement])
return renderInputElement?.() ?? inputElement ?? <DatePickerInput />
}, [inputElement, renderInputElement])

if (isMobile) {
return (
Expand Down
9 changes: 9 additions & 0 deletions react/src/DatePicker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,14 @@ export interface DatePickerBaseProps
refocusOnClose?: boolean
/** date-fns's Locale of the date to be applied if provided. */
locale?: Locale
/**
* @deprecated use `renderInputElement` instead. If `renderInputElement` is provided,
* that will take precedence over `inputElement`.
*/
inputElement?: React.ReactElement
/**
* If provided, the value will be used instead of the default `DatePickerInput` component.
* @returns
*/
renderInputElement?: () => React.ReactElement
}

0 comments on commit b43b610

Please sign in to comment.