From 6e7737ef0bac129b5113f5d05d458972d8da04d7 Mon Sep 17 00:00:00 2001 From: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:54:41 -0500 Subject: [PATCH 1/4] docs(datetime): add best practices for setting value async (#3053) --- docs/api/datetime.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/datetime.md b/docs/api/datetime.md index c166841c37a..26368c8f2b6 100644 --- a/docs/api/datetime.md +++ b/docs/api/datetime.md @@ -98,6 +98,10 @@ While seconds, milliseconds, and time zone can be specified using the ISO 8601 d If you need to present a datetime in an overlay such as a modal or a popover, we recommend using [ion-datetime-button](./datetime-button). `ion-datetime-button` should be used when space is constrained. This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open in the overlay. +## Setting Values Asynchronously + +If its `value` is updated programmatically after a datetime has already been created, the datetime will automatically jump to the new date. However, it is recommended to avoid updating the `value` in this way when users are able to interact with the datetime, as this could be disorienting for those currently trying to select a date. For example, if a datetime's `value` is loaded by an asyncronous process, it is recommended to hide the datetime with CSS until the value has finished updating. + ## Date Constraints ### Max and Min Dates From 56a80608e9ba65296d32fe1b9f352f49c88077ea Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Tue, 5 Sep 2023 14:31:29 -0700 Subject: [PATCH 2/4] feat(checkbox, radio, toggle, range): stacked labels for form controls (#3097) Co-authored-by: Brandy Carney --- docs/api/checkbox.md | 16 +++++++-- docs/api/radio.md | 17 ++++++++-- docs/api/toggle.md | 12 ++++++- .../code/stackblitz/v7/angular/package.json | 4 +-- static/code/stackblitz/v7/html/package.json | 2 +- static/code/stackblitz/v7/react/package.json | 4 +-- static/code/stackblitz/v7/vue/package.json | 4 +-- static/usage/v7/checkbox/alignment/angular.md | 11 ++++++ static/usage/v7/checkbox/alignment/demo.html | 29 ++++++++++++++++ static/usage/v7/checkbox/alignment/index.md | 17 ++++++++++ .../usage/v7/checkbox/alignment/javascript.md | 11 ++++++ static/usage/v7/checkbox/alignment/react.md | 25 ++++++++++++++ static/usage/v7/checkbox/alignment/vue.md | 24 +++++++++++++ .../v7/checkbox/label-placement/angular.md | 4 +++ .../v7/checkbox/label-placement/demo.html | 4 +++ .../v7/checkbox/label-placement/javascript.md | 4 +++ .../v7/checkbox/label-placement/react.md | 4 +++ .../usage/v7/checkbox/label-placement/vue.md | 4 +++ static/usage/v7/radio/alignment/angular.md | 15 ++++++++ static/usage/v7/radio/alignment/demo.html | 34 +++++++++++++++++++ static/usage/v7/radio/alignment/index.md | 17 ++++++++++ static/usage/v7/radio/alignment/javascript.md | 15 ++++++++ static/usage/v7/radio/alignment/react.md | 27 +++++++++++++++ static/usage/v7/radio/alignment/vue.md | 26 ++++++++++++++ .../usage/v7/radio/label-placement/angular.md | 6 ++++ .../usage/v7/radio/label-placement/demo.html | 6 ++++ .../v7/radio/label-placement/javascript.md | 6 ++++ .../usage/v7/radio/label-placement/react.md | 8 +++++ static/usage/v7/radio/label-placement/vue.md | 6 ++++ static/usage/v7/range/labels/angular.md | 4 +++ static/usage/v7/range/labels/demo.html | 4 +++ static/usage/v7/range/labels/javascript.md | 4 +++ static/usage/v7/range/labels/react.md | 4 +++ static/usage/v7/range/labels/vue.md | 4 +++ static/usage/v7/toggle/alignment/angular.md | 4 +++ static/usage/v7/toggle/alignment/demo.html | 25 ++++++++++++++ static/usage/v7/toggle/alignment/index.md | 17 ++++++++++ .../usage/v7/toggle/alignment/javascript.md | 4 +++ static/usage/v7/toggle/alignment/react.md | 20 +++++++++++ static/usage/v7/toggle/alignment/vue.md | 17 ++++++++++ .../v7/toggle/label-placement/angular.md | 1 + .../usage/v7/toggle/label-placement/demo.html | 1 + .../v7/toggle/label-placement/javascript.md | 1 + .../usage/v7/toggle/label-placement/react.md | 1 + static/usage/v7/toggle/label-placement/vue.md | 1 + 45 files changed, 461 insertions(+), 13 deletions(-) create mode 100644 static/usage/v7/checkbox/alignment/angular.md create mode 100644 static/usage/v7/checkbox/alignment/demo.html create mode 100644 static/usage/v7/checkbox/alignment/index.md create mode 100644 static/usage/v7/checkbox/alignment/javascript.md create mode 100644 static/usage/v7/checkbox/alignment/react.md create mode 100644 static/usage/v7/checkbox/alignment/vue.md create mode 100644 static/usage/v7/radio/alignment/angular.md create mode 100644 static/usage/v7/radio/alignment/demo.html create mode 100644 static/usage/v7/radio/alignment/index.md create mode 100644 static/usage/v7/radio/alignment/javascript.md create mode 100644 static/usage/v7/radio/alignment/react.md create mode 100644 static/usage/v7/radio/alignment/vue.md create mode 100644 static/usage/v7/toggle/alignment/angular.md create mode 100644 static/usage/v7/toggle/alignment/demo.html create mode 100644 static/usage/v7/toggle/alignment/index.md create mode 100644 static/usage/v7/toggle/alignment/javascript.md create mode 100644 static/usage/v7/toggle/alignment/react.md create mode 100644 static/usage/v7/toggle/alignment/vue.md diff --git a/docs/api/checkbox.md b/docs/api/checkbox.md index fdfbe1c8a48..c43a878a0ce 100644 --- a/docs/api/checkbox.md +++ b/docs/api/checkbox.md @@ -29,15 +29,27 @@ import Basic from '@site/static/usage/v7/checkbox/basic/index.md'; ## Label Placement -Developers can use the `labelPlacement` property to control how the label is placed relative to the control. +Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property. import LabelPlacement from '@site/static/usage/v7/checkbox/label-placement/index.md'; +## Alignment + +Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property. + +:::note +Stacked checkboxes can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally. +::: + +import Alignment from '@site/static/usage/v7/checkbox/alignment/index.md'; + + + ## Justification -Developers can use the `justify` property to control how the label and control are packed on a line. +Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property. import Justify from '@site/static/usage/v7/checkbox/justify/index.md'; diff --git a/docs/api/radio.md b/docs/api/radio.md index c9b659ed8aa..9473c5cc790 100644 --- a/docs/api/radio.md +++ b/docs/api/radio.md @@ -30,21 +30,32 @@ import Basic from '@site/static/usage/v7/radio/basic/index.md'; ## Label Placement -Developers can use the `labelPlacement` property to control how the label is placed relative to the control. +Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property. import LabelPlacement from '@site/static/usage/v7/radio/label-placement/index.md'; +## Alignment + +Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property. + +:::note +Stacked radios can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally. +::: + +import Alignment from '@site/static/usage/v7/radio/alignment/index.md'; + + + ## Justification -Developers can use the `justify` property to control how the label and control are packed on a line. +Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property. import Justify from '@site/static/usage/v7/radio/justify/index.md'; - :::note `ion-item` is only used in the demos to emphasize how `justify` works. It is not needed in order for `justify` to function correctly. ::: diff --git a/docs/api/toggle.md b/docs/api/toggle.md index 336821e90be..0af93c616ea 100644 --- a/docs/api/toggle.md +++ b/docs/api/toggle.md @@ -53,6 +53,17 @@ import LabelPlacement from '@site/static/usage/v7/toggle/label-placement/index.m +## Alignment + +Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property. + +:::note +Stacked toggles can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally. +::: + +import Alignment from '@site/static/usage/v7/toggle/alignment/index.md'; + + ## Justification @@ -62,7 +73,6 @@ import Justify from '@site/static/usage/v7/toggle/justify/index.md'; - ## Theming ### Colors diff --git a/static/code/stackblitz/v7/angular/package.json b/static/code/stackblitz/v7/angular/package.json index 66f368834db..cefb6716d28 100644 --- a/static/code/stackblitz/v7/angular/package.json +++ b/static/code/stackblitz/v7/angular/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@ionic/angular": "^7.0.0", - "@ionic/core": "^7.0.0" + "@ionic/angular": "7.3.2-dev.11693507138.1f9ed625", + "@ionic/core": "7.3.2-dev.11693507138.1f9ed625" } } diff --git a/static/code/stackblitz/v7/html/package.json b/static/code/stackblitz/v7/html/package.json index 7583138334d..197e88283c5 100644 --- a/static/code/stackblitz/v7/html/package.json +++ b/static/code/stackblitz/v7/html/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@ionic/core": "^7.0.0" + "@ionic/core": "7.3.2-dev.11693507138.1f9ed625" } } diff --git a/static/code/stackblitz/v7/react/package.json b/static/code/stackblitz/v7/react/package.json index 9e3c1a361ff..c81f0d18330 100644 --- a/static/code/stackblitz/v7/react/package.json +++ b/static/code/stackblitz/v7/react/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "dependencies": { - "@ionic/react": "^7.0.10", - "@ionic/react-router": "^7.0.10", + "@ionic/react": "7.3.2-dev.11693507138.1f9ed625", + "@ionic/react-router": "7.3.2-dev.11693507138.1f9ed625", "@types/node": "^16.11.35", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.4", diff --git a/static/code/stackblitz/v7/vue/package.json b/static/code/stackblitz/v7/vue/package.json index 5d661e04f57..a953097ada0 100644 --- a/static/code/stackblitz/v7/vue/package.json +++ b/static/code/stackblitz/v7/vue/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@ionic/vue": "^7.0.10", - "@ionic/vue-router": "^7.0.10", + "@ionic/vue": "7.3.2-dev.11693507138.1f9ed625", + "@ionic/vue-router": "7.3.2-dev.11693507138.1f9ed625", "vue": "^3.2.25", "vue-router": "4.0.13" }, diff --git a/static/usage/v7/checkbox/alignment/angular.md b/static/usage/v7/checkbox/alignment/angular.md new file mode 100644 index 00000000000..4cb28d1b19b --- /dev/null +++ b/static/usage/v7/checkbox/alignment/angular.md @@ -0,0 +1,11 @@ +```html + + + Aligned to the Start + + + + Aligned to the Center + + +``` diff --git a/static/usage/v7/checkbox/alignment/demo.html b/static/usage/v7/checkbox/alignment/demo.html new file mode 100644 index 00000000000..8cd4888c61b --- /dev/null +++ b/static/usage/v7/checkbox/alignment/demo.html @@ -0,0 +1,29 @@ + + + + + + Checkbox + + + + + + + + +
+ + + Aligned to the Start + + + + Aligned to the Center + + +
+
+
+ + diff --git a/static/usage/v7/checkbox/alignment/index.md b/static/usage/v7/checkbox/alignment/index.md new file mode 100644 index 00000000000..80aa3a8c538 --- /dev/null +++ b/static/usage/v7/checkbox/alignment/index.md @@ -0,0 +1,17 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/v7/checkbox/alignment/javascript.md b/static/usage/v7/checkbox/alignment/javascript.md new file mode 100644 index 00000000000..4cb28d1b19b --- /dev/null +++ b/static/usage/v7/checkbox/alignment/javascript.md @@ -0,0 +1,11 @@ +```html + + + Aligned to the Start + + + + Aligned to the Center + + +``` diff --git a/static/usage/v7/checkbox/alignment/react.md b/static/usage/v7/checkbox/alignment/react.md new file mode 100644 index 00000000000..16b9d9b18e2 --- /dev/null +++ b/static/usage/v7/checkbox/alignment/react.md @@ -0,0 +1,25 @@ +```tsx +import React from 'react'; +import { IonCheckbox, IonItem, IonList } from '@ionic/react'; + +function Example() { + return ( + <> + + + + Aligned to the Start + + + + + + Aligned to the Center + + + + + ); +} +export default Example; +``` diff --git a/static/usage/v7/checkbox/alignment/vue.md b/static/usage/v7/checkbox/alignment/vue.md new file mode 100644 index 00000000000..4dffcd383aa --- /dev/null +++ b/static/usage/v7/checkbox/alignment/vue.md @@ -0,0 +1,24 @@ +```html + + + +``` diff --git a/static/usage/v7/checkbox/label-placement/angular.md b/static/usage/v7/checkbox/label-placement/angular.md index f2cb87d8171..154f82929d8 100644 --- a/static/usage/v7/checkbox/label-placement/angular.md +++ b/static/usage/v7/checkbox/label-placement/angular.md @@ -8,4 +8,8 @@
Fixed Width Label + +
+ +Stacked Label ``` diff --git a/static/usage/v7/checkbox/label-placement/demo.html b/static/usage/v7/checkbox/label-placement/demo.html index 68f4256f4c1..b010f8e8a3e 100644 --- a/static/usage/v7/checkbox/label-placement/demo.html +++ b/static/usage/v7/checkbox/label-placement/demo.html @@ -24,6 +24,10 @@
Fixed Width Label + +
+ + Stacked Label diff --git a/static/usage/v7/checkbox/label-placement/javascript.md b/static/usage/v7/checkbox/label-placement/javascript.md index e3321ed4f9b..be18191d9a0 100644 --- a/static/usage/v7/checkbox/label-placement/javascript.md +++ b/static/usage/v7/checkbox/label-placement/javascript.md @@ -8,4 +8,8 @@
Fixed Width Label + +
+ +Stacked Label ``` diff --git a/static/usage/v7/checkbox/label-placement/react.md b/static/usage/v7/checkbox/label-placement/react.md index 7c9bf728131..6fc222b9035 100644 --- a/static/usage/v7/checkbox/label-placement/react.md +++ b/static/usage/v7/checkbox/label-placement/react.md @@ -14,6 +14,10 @@ function Example() {
Fixed Width Label + +
+ + Stacked Label ); } diff --git a/static/usage/v7/checkbox/label-placement/vue.md b/static/usage/v7/checkbox/label-placement/vue.md index 942149628cd..3530731da53 100644 --- a/static/usage/v7/checkbox/label-placement/vue.md +++ b/static/usage/v7/checkbox/label-placement/vue.md @@ -9,6 +9,10 @@
Fixed Width Label + +
+ + Stacked Label + + + + + + + +
+ + + + Aligned to the Start + + + + + + Aligned to the Center + + + +
+
+
+ + diff --git a/static/usage/v7/radio/alignment/index.md b/static/usage/v7/radio/alignment/index.md new file mode 100644 index 00000000000..eb491f6f693 --- /dev/null +++ b/static/usage/v7/radio/alignment/index.md @@ -0,0 +1,17 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/v7/radio/alignment/javascript.md b/static/usage/v7/radio/alignment/javascript.md new file mode 100644 index 00000000000..37f54368452 --- /dev/null +++ b/static/usage/v7/radio/alignment/javascript.md @@ -0,0 +1,15 @@ +```html + + + + Aligned to the Start + + + + + + Aligned to the Center + + + +``` diff --git a/static/usage/v7/radio/alignment/react.md b/static/usage/v7/radio/alignment/react.md new file mode 100644 index 00000000000..f7fcb232aea --- /dev/null +++ b/static/usage/v7/radio/alignment/react.md @@ -0,0 +1,27 @@ +```tsx +import React from 'react'; +import { IonItem, IonList, IonRadio, IonRadioGroup } from '@ionic/react'; + +function Example() { + return ( + + + + + Aligned to the Start + + + + + + + + Aligned to the Center + + + + + ); +} +export default Example; +``` diff --git a/static/usage/v7/radio/alignment/vue.md b/static/usage/v7/radio/alignment/vue.md new file mode 100644 index 00000000000..0f208b37a2a --- /dev/null +++ b/static/usage/v7/radio/alignment/vue.md @@ -0,0 +1,26 @@ +```html + + + +``` diff --git a/static/usage/v7/radio/label-placement/angular.md b/static/usage/v7/radio/label-placement/angular.md index 9caedfee363..c62acb2938a 100644 --- a/static/usage/v7/radio/label-placement/angular.md +++ b/static/usage/v7/radio/label-placement/angular.md @@ -14,4 +14,10 @@ Fixed Width Label + +
+ + + Stacked Label + ``` diff --git a/static/usage/v7/radio/label-placement/demo.html b/static/usage/v7/radio/label-placement/demo.html index b038df4eb0e..8140ef0ed29 100644 --- a/static/usage/v7/radio/label-placement/demo.html +++ b/static/usage/v7/radio/label-placement/demo.html @@ -30,6 +30,12 @@ Fixed Width Label + +
+ + + Stacked Label + diff --git a/static/usage/v7/radio/label-placement/javascript.md b/static/usage/v7/radio/label-placement/javascript.md index f19fa4b10ac..44a731a1fae 100644 --- a/static/usage/v7/radio/label-placement/javascript.md +++ b/static/usage/v7/radio/label-placement/javascript.md @@ -14,4 +14,10 @@ Fixed Width Label + +
+ + + Stacked Label + ``` diff --git a/static/usage/v7/radio/label-placement/react.md b/static/usage/v7/radio/label-placement/react.md index 8827af5225f..42eb433075d 100644 --- a/static/usage/v7/radio/label-placement/react.md +++ b/static/usage/v7/radio/label-placement/react.md @@ -26,6 +26,14 @@ function Example() { Fixed Width Label + +
+ + + + Stacked Label + + ); } diff --git a/static/usage/v7/radio/label-placement/vue.md b/static/usage/v7/radio/label-placement/vue.md index 3562db1c507..d397b8ce31b 100644 --- a/static/usage/v7/radio/label-placement/vue.md +++ b/static/usage/v7/radio/label-placement/vue.md @@ -15,6 +15,12 @@ Fixed Width Label + +
+ + + Stacked Label + + + + + + + + +
+
+ Aligned to the Start

+ Aligned to the Center

+
+
+
+
+ + diff --git a/static/usage/v7/toggle/alignment/index.md b/static/usage/v7/toggle/alignment/index.md new file mode 100644 index 00000000000..0d94dbd5e1e --- /dev/null +++ b/static/usage/v7/toggle/alignment/index.md @@ -0,0 +1,17 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/v7/toggle/alignment/javascript.md b/static/usage/v7/toggle/alignment/javascript.md new file mode 100644 index 00000000000..b40b7ba1014 --- /dev/null +++ b/static/usage/v7/toggle/alignment/javascript.md @@ -0,0 +1,4 @@ +```html +Aligned to the Start

+Aligned to the Center +``` diff --git a/static/usage/v7/toggle/alignment/react.md b/static/usage/v7/toggle/alignment/react.md new file mode 100644 index 00000000000..6af4a181100 --- /dev/null +++ b/static/usage/v7/toggle/alignment/react.md @@ -0,0 +1,20 @@ +```tsx +import React from 'react'; +import { IonToggle } from '@ionic/react'; + +function Example() { + return ( + <> + + Aligned to the Start + +
+
+ + Aligned to the Center + + + ); +} +export default Example; +``` diff --git a/static/usage/v7/toggle/alignment/vue.md b/static/usage/v7/toggle/alignment/vue.md new file mode 100644 index 00000000000..b3bce543aa6 --- /dev/null +++ b/static/usage/v7/toggle/alignment/vue.md @@ -0,0 +1,17 @@ +```html + + + +``` diff --git a/static/usage/v7/toggle/label-placement/angular.md b/static/usage/v7/toggle/label-placement/angular.md index cc9ad6fcafc..390ea7bda37 100644 --- a/static/usage/v7/toggle/label-placement/angular.md +++ b/static/usage/v7/toggle/label-placement/angular.md @@ -2,4 +2,5 @@ Label at the Start

Label at the End

Fixed Width Label

+Stacked Label ``` diff --git a/static/usage/v7/toggle/label-placement/demo.html b/static/usage/v7/toggle/label-placement/demo.html index 915b4677bc9..9f2d4d1d1cf 100644 --- a/static/usage/v7/toggle/label-placement/demo.html +++ b/static/usage/v7/toggle/label-placement/demo.html @@ -18,6 +18,7 @@ Label at the Start

Label at the End

Fixed Width Label

+ Stacked Label

diff --git a/static/usage/v7/toggle/label-placement/javascript.md b/static/usage/v7/toggle/label-placement/javascript.md index 86a03cc0971..ab259436848 100644 --- a/static/usage/v7/toggle/label-placement/javascript.md +++ b/static/usage/v7/toggle/label-placement/javascript.md @@ -2,4 +2,5 @@ Label at the Start

Label at the End

Fixed Width Label

+Stacked Label ``` diff --git a/static/usage/v7/toggle/label-placement/react.md b/static/usage/v7/toggle/label-placement/react.md index 57940403843..a6fe77d7a02 100644 --- a/static/usage/v7/toggle/label-placement/react.md +++ b/static/usage/v7/toggle/label-placement/react.md @@ -14,6 +14,7 @@ function Example() { Fixed Width Label

+ Stacked Label ); } diff --git a/static/usage/v7/toggle/label-placement/vue.md b/static/usage/v7/toggle/label-placement/vue.md index 682472e8d05..c9cfea701e1 100644 --- a/static/usage/v7/toggle/label-placement/vue.md +++ b/static/usage/v7/toggle/label-placement/vue.md @@ -3,6 +3,7 @@ Label at the Start

Label at the End

Fixed Width Label

+ Stacked Label + + + + + + + + + +
+ +
+
+
+ + + + diff --git a/static/usage/v7/datetime/styling/calendar-days/index.md b/static/usage/v7/datetime/styling/calendar-days/index.md new file mode 100644 index 00000000000..4ab6c14f639 --- /dev/null +++ b/static/usage/v7/datetime/styling/calendar-days/index.md @@ -0,0 +1,35 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; + +import react_main_tsx from './react/main_tsx.md'; +import react_main_css from './react/main_css.md'; + +import vue from './vue.md'; + +import angular_example_component_html from './angular/example_component_html.md'; +import angular_example_component_css from './angular/example_component_css.md'; +import angular_example_component_ts from './angular/example_component_ts.md'; + + diff --git a/static/usage/v7/datetime/styling/calendar-days/javascript.md b/static/usage/v7/datetime/styling/calendar-days/javascript.md new file mode 100644 index 00000000000..20aa37bb016 --- /dev/null +++ b/static/usage/v7/datetime/styling/calendar-days/javascript.md @@ -0,0 +1,72 @@ +```html + + + + + +``` diff --git a/static/usage/v7/datetime/styling/calendar-days/react/main_css.md b/static/usage/v7/datetime/styling/calendar-days/react/main_css.md new file mode 100644 index 00000000000..c8a3e173e21 --- /dev/null +++ b/static/usage/v7/datetime/styling/calendar-days/react/main_css.md @@ -0,0 +1,46 @@ +```css +/* +* Custom Datetime Day Parts +* ------------------------------------------- +*/ + +ion-datetime::part(calendar-day) { + color: #da5296; +} + +ion-datetime::part(calendar-day today) { + color: #8462d1; +} + +ion-datetime::part(calendar-day):focus { + background-color: rgb(154 209 98 / 0.2); + box-shadow: 0px 0px 0px 4px rgb(154 209 98 / 0.2); +} + +/* +* Custom Material Design Datetime Day Parts +* ------------------------------------------- +*/ + +ion-datetime.md::part(calendar-day active), +ion-datetime.md::part(calendar-day active):focus { + background-color: #9ad162; + border-color: #9ad162; + color: #fff; +} + +ion-datetime.md::part(calendar-day today) { + border-color: #8462d1; +} + +/* +* Custom iOS Datetime Day Parts +* ------------------------------------------- +*/ + +ion-datetime.ios::part(calendar-day active), +ion-datetime.ios::part(calendar-day active):focus { + background-color: rgb(154 209 98 / 0.2); + color: #9ad162; +} +``` diff --git a/static/usage/v7/datetime/styling/calendar-days/react/main_tsx.md b/static/usage/v7/datetime/styling/calendar-days/react/main_tsx.md new file mode 100644 index 00000000000..fc76cb27d59 --- /dev/null +++ b/static/usage/v7/datetime/styling/calendar-days/react/main_tsx.md @@ -0,0 +1,33 @@ +```tsx +import React, { useEffect, useState } from 'react'; +import { IonDatetime } from '@ionic/react'; + +import './main.css'; + +function Example() { + const [datetime, setDatetime] = useState(null); + + useEffect(() => { + const date = new Date(); + + // Set the value of the datetime to 2 days + // before the current day + let dayChange = -2; + + // If the day we are going to set the value to + // is in the previous month then set the day 2 days + // later instead so it remains in the same month + if (date.getDate() + dayChange <= 0) { + dayChange = -dayChange; + } + + // Set the value of the datetime to the day + // calculated above + date.setDate(date.getDate() + dayChange); + setDatetime(date.toISOString()); + }, []); + + return ; +} +export default Example; +``` diff --git a/static/usage/v7/datetime/styling/calendar-days/vue.md b/static/usage/v7/datetime/styling/calendar-days/vue.md new file mode 100644 index 00000000000..98031201d7c --- /dev/null +++ b/static/usage/v7/datetime/styling/calendar-days/vue.md @@ -0,0 +1,88 @@ +```html + + + + + +``` diff --git a/static/usage/v7/datetime/styling/wheel-styling/angular/example_component_ts.md b/static/usage/v7/datetime/styling/wheel-styling/angular/example_component_ts.md new file mode 100644 index 00000000000..39bac10093c --- /dev/null +++ b/static/usage/v7/datetime/styling/wheel-styling/angular/example_component_ts.md @@ -0,0 +1,14 @@ +```ts +import { Component, ViewEncapsulation } from '@angular/core'; + +// ViewEncapsulation is turned off for this demo due to +// a lack of support for styling multiple css shadow parts +// See https://github.com/angular/angular/issues/22515 +@Component({ + selector: 'app-example', + templateUrl: 'example.component.html', + styleUrls: ['example.component.css'], + encapsulation: ViewEncapsulation.None, +}) +export class ExampleComponent {} +``` diff --git a/static/usage/v7/datetime/styling/wheel-styling/index.md b/static/usage/v7/datetime/styling/wheel-styling/index.md index 4cc1808f81b..25fab2a4910 100644 --- a/static/usage/v7/datetime/styling/wheel-styling/index.md +++ b/static/usage/v7/datetime/styling/wheel-styling/index.md @@ -9,6 +9,7 @@ import vue from './vue.md'; import angular_example_component_html from './angular/example_component_html.md'; import angular_example_component_css from './angular/example_component_css.md'; +import angular_example_component_ts from './angular/example_component_ts.md'; Date: Wed, 6 Sep 2023 09:01:09 -0700 Subject: [PATCH 4/4] chore(angular, html, react, vue): revert package versions on stackblitz (#3106) --- static/code/stackblitz/v7/angular/package.json | 4 ++-- static/code/stackblitz/v7/html/package.json | 2 +- static/code/stackblitz/v7/react/package.json | 4 ++-- static/code/stackblitz/v7/vue/package.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/static/code/stackblitz/v7/angular/package.json b/static/code/stackblitz/v7/angular/package.json index cefb6716d28..66f368834db 100644 --- a/static/code/stackblitz/v7/angular/package.json +++ b/static/code/stackblitz/v7/angular/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@ionic/angular": "7.3.2-dev.11693507138.1f9ed625", - "@ionic/core": "7.3.2-dev.11693507138.1f9ed625" + "@ionic/angular": "^7.0.0", + "@ionic/core": "^7.0.0" } } diff --git a/static/code/stackblitz/v7/html/package.json b/static/code/stackblitz/v7/html/package.json index 197e88283c5..7583138334d 100644 --- a/static/code/stackblitz/v7/html/package.json +++ b/static/code/stackblitz/v7/html/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@ionic/core": "7.3.2-dev.11693507138.1f9ed625" + "@ionic/core": "^7.0.0" } } diff --git a/static/code/stackblitz/v7/react/package.json b/static/code/stackblitz/v7/react/package.json index c81f0d18330..9e3c1a361ff 100644 --- a/static/code/stackblitz/v7/react/package.json +++ b/static/code/stackblitz/v7/react/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "dependencies": { - "@ionic/react": "7.3.2-dev.11693507138.1f9ed625", - "@ionic/react-router": "7.3.2-dev.11693507138.1f9ed625", + "@ionic/react": "^7.0.10", + "@ionic/react-router": "^7.0.10", "@types/node": "^16.11.35", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.4", diff --git a/static/code/stackblitz/v7/vue/package.json b/static/code/stackblitz/v7/vue/package.json index a953097ada0..5d661e04f57 100644 --- a/static/code/stackblitz/v7/vue/package.json +++ b/static/code/stackblitz/v7/vue/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@ionic/vue": "7.3.2-dev.11693507138.1f9ed625", - "@ionic/vue-router": "7.3.2-dev.11693507138.1f9ed625", + "@ionic/vue": "^7.0.10", + "@ionic/vue-router": "^7.0.10", "vue": "^3.2.25", "vue-router": "4.0.13" },