diff --git a/packages/form-js-carbon-styles/src/carbon-styles.js b/packages/form-js-carbon-styles/src/carbon-styles.js index 4dffb2761..517cc2d8d 100644 --- a/packages/form-js-carbon-styles/src/carbon-styles.js +++ b/packages/form-js-carbon-styles/src/carbon-styles.js @@ -860,49 +860,10 @@ const DATETIME_INPUTS = css` position: unset; } - .flatpickr-calendar.static { - top: calc(100% + 3px); - } - .flatpickr-calendar .flatpickr-prev-month svg, .flatpickr-calendar .flatpickr-next-month svg { height: 16px; } - - .flatpickr-day.today { - position: relative; - color: var(--cds-link-primary); - font-weight: 600; - border-color: transparent; - } - - .flatpickr-day.selected, - .flatpickr-day.today.selected, - .flatpickr-day.selected:hover, - .flatpickr-day.today.selected:hover { - background-color: var(--cds-button-primary); - color: var(--cds-text-on-color); - } - - .flatpickr-day:focus { - outline: 2px solid var(--cds-focus); - outline-offset: -2px; - } - - .flatpickr-day.selected:focus { - outline: 0.0625rem solid var(--cds-focus); - outline-offset: -0.1875rem; - } - - .flatpickr-day:hover { - background: var(--cds-layer-hover); - } - - .flatpickr-days, - .flatpickr-weekdays { - padding: unset; - width: unset; - } } } `} diff --git a/packages/form-js-viewer/assets/flatpickr-light.scss b/packages/form-js-viewer/assets/flatpickr-light.scss new file mode 100644 index 000000000..816f097a1 --- /dev/null +++ b/packages/form-js-viewer/assets/flatpickr-light.scss @@ -0,0 +1,51 @@ +@use "flatpickr/dist/themes/light.css"; + +/** +* Flatpickr style adjustments +*/ + +.fjs-container .flatpickr-day.today { + border-color: transparent; + background-color: transparent; + font-weight: bold; +} + +.fjs-container .flatpickr-day.today:hover, +.fjs-container .flatpickr-day.today:focus { + border-color: var(--color-borders); + background-color: var(--color-datepicker-focused-day); + color: var(--color-text-inverted); +} + +.fjs-container .flatpickr-day.selected { + border-color: var(--color-accent); + background-color: inherit; + color: inherit; + font-weight: normal; +} + +.fjs-container .flatpickr-day.selected.today { + font-weight: bold; +} + +.fjs-container .flatpickr-day.selected:hover, +.fjs-container .flatpickr-day.selected:focus { + background-color: var(--color-accent); + font-weight: bold; + color: var(--color-text-inverted); + border-color: var(--color-accent); +} + +.fjs-container .flatpickr-days, .flatpickr-weekdays { + padding: 10px; + width: 100%; +} + +.fjs-container .flatpickr-calendar.hasTime.noCalendar { + width: auto; + max-width: 250px; +} + +.fjs-container .flatpickr-calendar { + width: 326px; +} diff --git a/packages/form-js-viewer/assets/form-js-base.css b/packages/form-js-viewer/assets/form-js-base.css index 3f4cc9b7d..4905a0b5c 100644 --- a/packages/form-js-viewer/assets/form-js-base.css +++ b/packages/form-js-viewer/assets/form-js-base.css @@ -880,53 +880,3 @@ height: 64px; margin: 4px 0; } - -/** -* Flatpickr style adjustments -*/ - -.fjs-container .flatpickr-day.today { - border-color: transparent; - background-color: transparent; - font-weight: bold; -} - -.fjs-container .flatpickr-day.today:hover, -.fjs-container .flatpickr-day.today:focus { - border-color: var(--color-borders); - background-color: var(--color-datepicker-focused-day); - color: var(--color-text-inverted); -} - -.fjs-container .flatpickr-day.selected { - border-color: var(--color-accent); - background-color: inherit; - color: inherit; - font-weight: normal; -} - -.fjs-container .flatpickr-day.selected.today { - font-weight: bold; -} - -.fjs-container .flatpickr-day.selected:hover, -.fjs-container .flatpickr-day.selected:focus { - background-color: var(--color-accent); - font-weight: bold; - color: var(--color-text-inverted); - border-color: var(--color-accent); -} - -.fjs-container .flatpickr-days, .flatpickr-weekdays { - padding: 10px; - width: 100%; -} - -.fjs-container .flatpickr-calendar.hasTime.noCalendar { - width: auto; - max-width: 250px; -} - -.fjs-container .flatpickr-calendar { - width: 326px; -} diff --git a/packages/form-js-viewer/assets/form-js-carbon-compat.scss b/packages/form-js-viewer/assets/form-js-carbon-compat.scss new file mode 100644 index 000000000..9c76406e7 --- /dev/null +++ b/packages/form-js-viewer/assets/form-js-carbon-compat.scss @@ -0,0 +1,2 @@ +@use "form-js-base"; +@use "grid.scss"; \ No newline at end of file diff --git a/packages/form-js-viewer/assets/form-js.scss b/packages/form-js-viewer/assets/form-js.scss new file mode 100644 index 000000000..db5b30953 --- /dev/null +++ b/packages/form-js-viewer/assets/form-js.scss @@ -0,0 +1,3 @@ +@use "form-js-base"; +@use "grid.scss"; +@use "flatpickr-light.scss"; \ No newline at end of file diff --git a/packages/form-js-viewer/assets/index.scss b/packages/form-js-viewer/assets/index.scss deleted file mode 100644 index 6cd0dfeb1..000000000 --- a/packages/form-js-viewer/assets/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -@use "form-js-base.css"; -@use "grid.scss"; -@use "flatpickr/dist/themes/light.css"; \ No newline at end of file diff --git a/packages/form-js-viewer/package.json b/packages/form-js-viewer/package.json index efd4ff35d..b0739b276 100644 --- a/packages/form-js-viewer/package.json +++ b/packages/form-js-viewer/package.json @@ -23,7 +23,7 @@ "build": "run-p bundle bundle:scss generate-types", "start": "SINGLE_START=basic npm run dev", "bundle": "rollup -c --failAfterWarnings --bundleConfigAsCjs", - "bundle:scss": "sass --no-source-map --load-path=\"../../node_modules\" assets/index.scss dist/assets/form-js.css", + "bundle:scss": "sass --no-source-map --load-path=\"../../node_modules\" assets/form-js.scss:dist/assets/form-js.css assets/flatpickr-light.scss:dist/assets/flatpickr-light.css assets/form-js-carbon-compat.scss:dist/assets/form-js-carbon-compat.css", "bundle:watch": "run-p bundle:watch-js bundle:watch-scss", "bundle:watch-js": "rollup -c -w --bundleConfigAsCjs", "bundle:watch-scss": "npm run bundle:scss -- --watch", diff --git a/packages/form-js-viewer/rollup.config.js b/packages/form-js-viewer/rollup.config.js index 7dbb50fc0..1d113c7ac 100644 --- a/packages/form-js-viewer/rollup.config.js +++ b/packages/form-js-viewer/rollup.config.js @@ -65,7 +65,6 @@ export default [ copy({ targets: [ { src: 'assets/form-js-base.css', dest: 'dist/assets' }, - { src: '../../node_modules/flatpickr/dist/themes/light.css', dest: 'dist/assets/flatpickr' } ] }) ]), diff --git a/packages/form-js/package.json b/packages/form-js/package.json index 70a1383b6..b9a8f3a15 100644 --- a/packages/form-js/package.json +++ b/packages/form-js/package.json @@ -19,7 +19,7 @@ "./dist/assets/form-js.css": "./dist/assets/form-js.css", "./dist/assets/form-js-base.css": "./dist/assets/form-js-base.css", "./dist/assets/dragula.css": "./dist/assets/dragula.css", - "./dist/assets/flatpickr/light.css": "./dist/assets/flatpickr/light.css", + "./dist/assets/flatpickr-light.css": "./dist/assets/flatpickr-light.css", "./dist/assets/properties-panel.css": "./dist/assets/properties-panel.css", "./dist/assets/form-js-editor.css": "./dist/assets/form-js-editor.css", "./dist/assets/form-js-editor-base.css": "./dist/assets/form-js-editor-base.css", diff --git a/packages/form-js/rollup.config.js b/packages/form-js/rollup.config.js index df9cee1f2..4ae1cf296 100644 --- a/packages/form-js/rollup.config.js +++ b/packages/form-js/rollup.config.js @@ -29,8 +29,7 @@ export default [ plugins: [ copy({ targets: [ - { src: '../../node_modules/@bpmn-io/form-js-viewer/dist/assets/**/*[!light].css', dest: 'dist/assets', }, - { src: '../../node_modules/@bpmn-io/form-js-viewer/dist/assets/flatpickr/*.css', dest: 'dist/assets/flatpickr', }, + { src: '../../node_modules/@bpmn-io/form-js-viewer/dist/assets/**/*.css', dest: 'dist/assets', }, { src: '../../node_modules/@bpmn-io/form-js-editor/dist/assets/**/*.css', dest: 'dist/assets' }, { src: '../../node_modules/@bpmn-io/form-js-playground/dist/assets/**/*.css', dest: 'dist/assets' }, { src: '../../node_modules/@bpmn-io/form-js-carbon-styles/src/carbon-styles.js', dest: 'dist' }