From 7f218ba23ce2efc2b56e097d6866444653bfb521 Mon Sep 17 00:00:00 2001 From: Rushi Vishavadia Date: Thu, 21 Sep 2023 18:14:30 +0530 Subject: [PATCH 1/5] npm publish workflow (#269) --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ .prettierignore | 1 + 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..cf8080aed --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages +name: Node.js Package + +on: + workflow_dispatch: + inputs: + tag: + description: "Tag version" + default: latest + required: true + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm run build + - run: npm publish --tag ${{ github.event.inputs.tag }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.prettierignore b/.prettierignore index 7aaac523e..18a8c6759 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ src/theme.js package-lock.json node_modules +.github From 33f31e1361645610ca5b3a27fcac099a98e6cfa1 Mon Sep 17 00:00:00 2001 From: Oleksandr Khomyakov Date: Fri, 22 Sep 2023 14:09:46 +0300 Subject: [PATCH 2/5] X2-7052: X2 account does not show start time in a listing schedule the way it does in V1 (#267) Added custom placeholder for select date --- src/components/DatePicker/DatePickerPopover.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/DatePicker/DatePickerPopover.jsx b/src/components/DatePicker/DatePickerPopover.jsx index eeb95d374..849565d55 100644 --- a/src/components/DatePicker/DatePickerPopover.jsx +++ b/src/components/DatePicker/DatePickerPopover.jsx @@ -11,6 +11,7 @@ export const DatePickerPopover = ({ value, variant = "single", dateFormat = "ddd, LL", + placeholder = "Select Date", onChange, children, classNames = {}, @@ -66,6 +67,7 @@ export const DatePickerPopover = ({ readOnly size="medium" value={value ? formatDate(value, dateFormat) : ""} + placeholder={placeholder} className={classNames?.input} onClick={toggleVisibility} /> @@ -103,7 +105,7 @@ const DefaultInput = forwardRef(({ className, ...rest }, reference) => { - +
From 9d47634a70806f02f76b4c19ee5177c0a79ee91d Mon Sep 17 00:00:00 2001 From: Manoj Vaibhav Date: Fri, 22 Sep 2023 16:41:35 +0530 Subject: [PATCH 3/5] 2.1.19 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 615d9900d..8740cc0e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@xola/ui-kit", - "version": "2.1.18", + "version": "2.1.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@xola/ui-kit", - "version": "2.1.18", + "version": "2.1.19", "license": "MIT", "dependencies": { "@headlessui/react": "^1.4.0", diff --git a/package.json b/package.json index 0fbc9e84d..31d4b655e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xola/ui-kit", - "version": "2.1.18", + "version": "2.1.19", "description": "Xola UI Kit", "license": "MIT", "files": [ From f969a4a02b0a51013c66bf553ba091710f34f5eb Mon Sep 17 00:00:00 2001 From: kirtesh-xola <136308620+kirtesh-xola@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:07:11 +0530 Subject: [PATCH 4/5] X2-7128 fix(datepicker): enhances ux for relative date range picker (#268) * X2-7128 fix(datepicker): enhances ux for relative date range picker 1. resolves issue, when user changes the month on right side calendar, it gets switched to the right side 2. hides days outside of current month * X2-7128 chore(datepicker): small css fix for outside days in date range picker --- src/components/DatePicker/DatePicker.css | 10 +++++----- src/components/DatePicker/DatePicker.jsx | 2 +- src/components/DatePicker/MonthYearSelector.jsx | 14 +++++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/DatePicker/DatePicker.css b/src/components/DatePicker/DatePicker.css index 0b1e18bd5..54808a06c 100644 --- a/src/components/DatePicker/DatePicker.css +++ b/src/components/DatePicker/DatePicker.css @@ -127,7 +127,7 @@ } /* Change the dates within the date to have the full light blue to show that it's a part of the range */ -.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--start):not(.DayPicker-Day--end) { +.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--start):not(.DayPicker-Day--end):not(.DayPicker-Day--outside) { @apply rounded-none bg-blue-lighter text-black; } @@ -149,8 +149,8 @@ @apply bg-transparent text-black; } -.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--disabled) .date, -.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--disabled) .date:hover { +.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) .date, +.date-range-picker .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) .date:hover { @apply bg-blue-lighter text-black; } @@ -167,7 +167,7 @@ } /* Make the start date have a 50% light blue background towards the RIGHT side */ -.date-range-picker .DayPicker-Day--start { +.date-range-picker .DayPicker-Day--start:not(.DayPicker-Day--outside) { @apply rounded-none; background: linear-gradient(90deg, #ffffff 40%, #d1e1ff 25%); } @@ -177,7 +177,7 @@ } /* Make the end date have a 50% light blue background towards the LEFT side */ -.date-range-picker .DayPicker-Day--end { +.date-range-picker .DayPicker-Day--end:not(.DayPicker-Day--outside) { @apply rounded-none; background: linear-gradient(90deg, #d1e1ff 40%, #ffffff 25%); /* D1E1FF Blue lighter */ } diff --git a/src/components/DatePicker/DatePicker.jsx b/src/components/DatePicker/DatePicker.jsx index 59fb0b8b3..d467ef76f 100644 --- a/src/components/DatePicker/DatePicker.jsx +++ b/src/components/DatePicker/DatePicker.jsx @@ -183,7 +183,7 @@ export const DatePicker = ({ ) : null} { + return 12 * (to.getFullYear() - from.getFullYear()) + (to.getMonth() - from.getMonth()); +}; + export const MonthYearSelector = ({ date, onChange, currentMonth }) => { const months = [...Array.from({ length: 12 }).keys()].map((m) => today.month(m).format("MMM")); // 2012 as baseline + 5 years in future @@ -12,9 +16,17 @@ export const MonthYearSelector = ({ date, onChange, currentMonth }) => { today.year(2012 + y).format("YYYY"), ); + /** + * For range date pickers, when we show multiple months, this indicates the index for selector component with respected to the first month selected in date-range picker (i.e. month selected on left side) + * + * @example + * If left side month is "August 2023", and we are showing this selector for "September 2023" (`date=2023-09-01T00:00:00Z`). The `selectorIndex` would be 1. + **/ + const selectorIndex = getDiffInMonths(date, currentMonth); + const handleMonthChange = (event) => { const { year, month } = event.target.form; - onChange(new Date(year.value, month.value)); + onChange(new Date(year.value, Number(month.value) - selectorIndex)); }; const handleYearChange = (event) => { From a74ffda26f0651059abc8df6f70a890878ec6ff7 Mon Sep 17 00:00:00 2001 From: Manoj Vaibhav Date: Mon, 25 Sep 2023 17:10:46 +0530 Subject: [PATCH 5/5] 2.1.20 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8740cc0e3..29638f83a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@xola/ui-kit", - "version": "2.1.19", + "version": "2.1.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@xola/ui-kit", - "version": "2.1.19", + "version": "2.1.20", "license": "MIT", "dependencies": { "@headlessui/react": "^1.4.0", diff --git a/package.json b/package.json index 31d4b655e..c2c7b6001 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xola/ui-kit", - "version": "2.1.19", + "version": "2.1.20", "description": "Xola UI Kit", "license": "MIT", "files": [