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

feat(input): add ionic theme styles and size property #29380

Open
wants to merge 39 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4fc3bbb
feat(input): add ionic theme (#29247)
brandyscarney Apr 1, 2024
e965443
feat(input): add the large size for the ionic theme (#29249)
brandyscarney Apr 3, 2024
3a1e70d
fix(input): update helper text color for ionic theme (#29269)
thetaPC Apr 4, 2024
5b62a1e
fix(input): update error text color for ionic theme (#29270)
thetaPC Apr 4, 2024
ca59d6c
chore(): sync with next branch (#29299)
amandaejohnston Apr 8, 2024
bb516f0
feat(input): add outline appearance for stacked label to ionic theme …
amandaejohnston Apr 9, 2024
c6b7dfe
Merge remote-tracking branch 'origin/next' into sp/ROU-4848-sync
sean-perkins Apr 10, 2024
3d7b669
Merge branch 'sp/ROU-4848-sync' into ROU-4848
sean-perkins Apr 10, 2024
96e5b2b
fix(input) match invalid state to ionic design (#29291)
thetaPC Apr 11, 2024
c30d685
feat(input): add hover state to the ionic theme (#29313)
brandyscarney Apr 11, 2024
67ec745
fix(input): match valid state to ionic design (#29277)
thetaPC Apr 11, 2024
6e45fef
test(input): change size tests to use stacked label placements (#29334)
amandaejohnston Apr 15, 2024
3b0f3af
fix(input): add disabled state to the ionic theme (#29323)
thetaPC Apr 15, 2024
cb71258
feat(input): add styles for round shape to ionic theme (#29329)
amandaejohnston Apr 16, 2024
ac102cf
feat(input): add styles for clear action to ionic theme (#29337)
amandaejohnston Apr 16, 2024
930f275
fix(input): add focused state for ionic theme (#29342)
thetaPC Apr 17, 2024
d7eb539
Merge branch 'next' into ROU-4848
brandyscarney Apr 23, 2024
c6127e9
chore(input): lint styles and add TODO for future work
brandyscarney Apr 23, 2024
c855add
Merge branch 'next' into ROU-4848
brandyscarney Apr 24, 2024
e0dfb61
feat(input): add item highlight for ionic theme (#29395)
sean-perkins Apr 29, 2024
4a4d447
fix(input): match medium size for ionic theme (#29403)
thetaPC Apr 30, 2024
09a0e6e
Merge branch 'next' into chore-sync-ROU-4848-next
brandyscarney May 3, 2024
5c7a782
chore(git): sync with next (#29454)
brandyscarney May 3, 2024
2eb1dbd
fix(input): add focus ring to the clear input button for ionic theme …
thetaPC May 3, 2024
0e792e6
fix(input): use correct padding for large (#29447)
thetaPC May 3, 2024
fd14ddf
fix(input): match design for xlarge size (#29446)
thetaPC May 3, 2024
7333376
fix(input): implement default shape for ionic theme (#29469)
thetaPC May 8, 2024
e17db2c
test(input): remove the .only within fill (#29478)
thetaPC May 9, 2024
75333c0
feat(input): add rectangular shape for the ionic theme (#29476)
brandyscarney May 9, 2024
c1bba3b
feat(input): add soft shape for ionic theme (#29477)
thetaPC May 9, 2024
8515c4e
fix(input): only apply the shape to the outline fill in ionic theme (…
brandyscarney May 10, 2024
09935fd
feat(input): add the readonly styles for the ionic theme (#29483)
brandyscarney May 10, 2024
ef7a454
chore(): add updated snapshots (#29492)
brandyscarney May 13, 2024
24c0bc3
Merge branch 'next' into chore-rou-4848-next
brandyscarney May 13, 2024
7a7a688
chore(git): update from next (#29495)
brandyscarney May 13, 2024
310bde6
Merge remote-tracking branch 'origin/next' into chore-sync-rou-4848-w…
thetaPC May 15, 2024
916d8a4
chore(git): sync next (#29511)
thetaPC May 16, 2024
bf8dfdb
feat(input): add styles for counter text on ionic theme (#29516)
brandyscarney May 17, 2024
7a4843b
fix(input): adjust colors, padding, fonts & heights for ionic theme (…
brandyscarney May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/api.txt
Expand Up @@ -616,7 +616,7 @@ ion-input,prop,fill,"outline" | "solid" | undefined,undefined,false,false
ion-input,prop,helperText,string | undefined,undefined,false,false
ion-input,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined,undefined,false,false
ion-input,prop,label,string | undefined,undefined,false,false
ion-input,prop,labelPlacement,"end" | "fixed" | "floating" | "stacked" | "start",'start',false,false
ion-input,prop,labelPlacement,"end" | "fixed" | "floating" | "stacked" | "start" | undefined,undefined,false,false
ion-input,prop,max,number | string | undefined,undefined,false,false
ion-input,prop,maxlength,number | undefined,undefined,false,false
ion-input,prop,min,number | string | undefined,undefined,false,false
Expand All @@ -629,6 +629,7 @@ ion-input,prop,placeholder,string | undefined,undefined,false,false
ion-input,prop,readonly,boolean,false,false,true
ion-input,prop,required,boolean,false,false,false
ion-input,prop,shape,"round" | undefined,undefined,false,false
ion-input,prop,size,"large" | "medium" | undefined,'medium',false,false
ion-input,prop,spellcheck,boolean,false,false,false
ion-input,prop,step,string | undefined,undefined,false,false
ion-input,prop,theme,"ios" | "md" | "ionic",undefined,false,false
Expand Down Expand Up @@ -658,6 +659,7 @@ ion-input,css-prop,--placeholder-color
ion-input,css-prop,--placeholder-font-style
ion-input,css-prop,--placeholder-font-weight
ion-input,css-prop,--placeholder-opacity
ion-input,css-prop,--text-color-invalid

ion-input-password-toggle,shadow
ion-input-password-toggle,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
Expand Down
14 changes: 11 additions & 3 deletions core/src/components.d.ts
Expand Up @@ -1419,9 +1419,9 @@ export namespace Components {
*/
"label"?: string;
/**
* Where to place the label relative to the input. `"start"`: The label will appear to the left of the input in LTR and to the right in RTL. `"end"`: The label will appear to the right of the input in LTR and to the left in RTL. `"floating"`: The label will appear smaller and above the input when the input is focused or it has a value. Otherwise it will appear on top of the input. `"stacked"`: The label will appear smaller and above the input regardless even when the input is blurred or has no value. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("...").
* Where to place the label relative to the input. `"start"`: The label will appear to the left of the input in LTR and to the right in RTL. `"end"`: The label will appear to the right of the input in LTR and to the left in RTL. `"floating"`: The label will appear smaller and above the input when the input is focused or it has a value. Otherwise it will appear on top of the input. `"stacked"`: The label will appear smaller and above the input regardless even when the input is blurred or has no value. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). Defaults to "stacked" for the ionic theme, or "start" for all other themes. In the ionic theme, only the values "stacked" and "floating" are supported.
*/
"labelPlacement": 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
"labelPlacement"?: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
/**
* The maximum value, which must not be less than its minimum (min attribute) value.
*/
Expand Down Expand Up @@ -1474,6 +1474,10 @@ export namespace Components {
* The shape of the input. If "round" it will have an increased border radius.
*/
"shape"?: 'round';
/**
* The size of the input. If "large", it will have an increased height. By default the size is medium. This property only applies to the `"ionic"` theme.
*/
"size"?: 'medium' | 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
Expand Down Expand Up @@ -6675,7 +6679,7 @@ declare namespace LocalJSX {
*/
"label"?: string;
/**
* Where to place the label relative to the input. `"start"`: The label will appear to the left of the input in LTR and to the right in RTL. `"end"`: The label will appear to the right of the input in LTR and to the left in RTL. `"floating"`: The label will appear smaller and above the input when the input is focused or it has a value. Otherwise it will appear on top of the input. `"stacked"`: The label will appear smaller and above the input regardless even when the input is blurred or has no value. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("...").
* Where to place the label relative to the input. `"start"`: The label will appear to the left of the input in LTR and to the right in RTL. `"end"`: The label will appear to the right of the input in LTR and to the left in RTL. `"floating"`: The label will appear smaller and above the input when the input is focused or it has a value. Otherwise it will appear on top of the input. `"stacked"`: The label will appear smaller and above the input regardless even when the input is blurred or has no value. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). Defaults to "stacked" for the ionic theme, or "start" for all other themes. In the ionic theme, only the values "stacked" and "floating" are supported.
*/
"labelPlacement"?: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
/**
Expand Down Expand Up @@ -6742,6 +6746,10 @@ declare namespace LocalJSX {
* The shape of the input. If "round" it will have an increased border radius.
*/
"shape"?: 'round';
/**
* The size of the input. If "large", it will have an increased height. By default the size is medium. This property only applies to the `"ionic"` theme.
*/
"size"?: 'medium' | 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
Expand Down
148 changes: 148 additions & 0 deletions core/src/components/input/input.ionic.outline.scss
@@ -0,0 +1,148 @@
@import "./input.vars";
@import "../../foundations/ionic.vars";

// Input Fill: Outline (Ionic Theme)
// ----------------------------------------------------------------

:host(.input-fill-outline) {
--border-radius: #{$ionic-border-radius-rounded-small};
--padding-start: 12px;
--padding-end: 12px;
}

:host(.input-fill-outline.input-size-large.input-shape-round) {
--padding-start: 16px;
--padding-end: 16px;
}

/**
* The bottom content should never have
* a border with the outline style.
*/
:host(.input-fill-outline) .input-bottom {
border-top: none;
}

:host(.input-fill-outline.input-shape-round) .input-bottom,
:host(.input-fill-outline.input-label-placement-floating) .input-bottom {
/**
* The bottom content should take on the start and end
* padding so it is always aligned with either the label
* or the start of the text input.
*/
@include padding-horizontal(var(--padding-start), var(--padding-end));
}

:host(.input-fill-outline) .input-wrapper {
/**
* For the ionic theme, the padding needs to sit on the
* native wrapper instead, so that it sits within the
* outline container but does not always affect the
* label text.
*/
@include padding(0);

/**
* Outline inputs do not have a bottom border.
* Instead, they have a border that wraps the
* input + label.
*/
border-bottom: none;
}

:host(.input-fill-outline.input-shape-round) .label-text-wrapper {
@include padding(null, var(--padding-end), null, var(--padding-start));
}

:host(.input-fill-outline.input-label-placement-stacked) .label-text-wrapper {
@include transform-origin(start, top);

/**
* Label text should not extend
* beyond the bounds of the input.
*/
max-width: calc(100% - var(--padding-start) - var(--padding-end));
}

:host(.input-fill-outline) .label-text-wrapper {
/**
* The label should appear on top of an outline
* container that overlaps it so it is always clickable.
*/
position: relative;

color: #{$ionic-color-neutral-700};
}

:host(.input-fill-outline) .native-wrapper {
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));

min-height: 40px;
}

// Input Fill: Outline, Outline Container
// ----------------------------------------------------------------

:host(.input-fill-outline) .input-outline {
@include position(0, 0, 0, 0);
@include border-radius(var(--border-radius));

position: absolute;

width: 100%;
height: 100%;

pointer-events: none;

border: var(--border-width) var(--border-style) var(--border-color);
}

// Input Fill: Outline, Label Placement: Stacked
// ----------------------------------------------------------------

// This makes the label sit above the input.
:host(.label-floating.input-fill-outline.input-label-placement-stacked) .label-text-wrapper {
@include transform(translateY(0), scale(#{$form-control-label-stacked-scale}));
@include margin(0);

/**
* Label text should not extend
* beyond the bounds of the input.
*/
max-width: calc((100% - var(--padding-start) - var(--padding-end)) / #{$form-control-label-stacked-scale});
}

// Start/End Slots
// ----------------------------------------------------------------

:host(.input-fill-outline) ::slotted([slot="start"]) {
margin-inline-end: 8px;
}

:host(.input-fill-outline) ::slotted([slot="end"]) {
margin-inline-start: 8px;
}

// Input - Disabled
// ----------------------------------------------------------------

:host(.input-fill-outline.input-disabled) {
// color for the text within the input
--color: #{$ionic-color-neutral-400};
--background: transparent;
}

:host(.input-fill-outline.input-disabled) .native-wrapper {
--background: #{$ionic-color-neutral-10};

@include border-radius(inherit);

background: var(--background);
}

// Input Focus
// ----------------------------------------------------------------

:host(.input-fill-outline.has-focus) {
--border-width: #{tokens.$ionic-border-size-medium};
}