-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(input): fill and outline support #26228
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
Merged
Merged
Changes from all commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
621dc13
feat(input): add new js and css props
liamdebeasi d24428c
chore(): copy updates
liamdebeasi 0402ae8
test(input): move old tests to legacy directory
liamdebeasi 7643d2d
feat(input): add legacy vs modern template rendering
liamdebeasi 259a3a2
refactor(form): add form controller
liamdebeasi a989e94
chore(): update comments
liamdebeasi 2a80a5f
chore(): update tests
liamdebeasi 08ea3a0
chore(): add moved screenshots
liamdebeasi bd80054
chore(): add moved screenshots
liamdebeasi 19f4994
chore(): fix test file
liamdebeasi d02c144
chore(): prettier
liamdebeasi cea5615
feat(input): add base functionality and tests
liamdebeasi 8d7f0c4
feat(input): add missing fixed label
liamdebeasi 6eabc11
feat(input): add basic help text rendering
liamdebeasi 0259004
feat(input): add helper and error text
liamdebeasi 5f765a0
chore(): update descriptions for clarity
liamdebeasi 3e4f70c
test(input): make sure correct content is rendered
liamdebeasi 232d868
test(input): make sure error color can be customized
liamdebeasi 2f6019b
chore(): update test
liamdebeasi 5c3bb0c
chore(): add updated snapshots
Ionitron f8dc97f
refactor(item): deprecate helper and error slots
liamdebeasi 23af9da
Merge branch '2591-helper' of https://github.com/ionic-team/ionic-fra…
liamdebeasi eeb7124
feat(input): add counter support
liamdebeasi b9da66c
refactor(item): deprecate counter and counterFormatter
liamdebeasi 516a615
chore(): a few tweaks
liamdebeasi 2d07367
test(input): clean up tests
liamdebeasi 4a4aca7
Merge remote-tracking branch 'origin/2591-helper' into 2591-counter
liamdebeasi f855134
test(input): add counter tests
liamdebeasi a7e4426
chore(): update prop description
liamdebeasi fff8ed1
Merge remote-tracking branch 'origin/FW-2591' into 2591-props
liamdebeasi 563f177
Update core/src/components/input/input.tsx
liamdebeasi e1696af
chore(): run build
liamdebeasi a17a9ae
Merge remote-tracking branch 'origin/2591-props' into 2591-template
liamdebeasi b458fe7
Merge remote-tracking branch 'origin/2591-template' into 2591-base
liamdebeasi eace2ec
Merge branch '2591-base' into 2591-helper
liamdebeasi 8be3a58
Merge remote-tracking branch 'origin/2591-helper' into 2591-counter
liamdebeasi f556aee
chore(input): remove justify property
liamdebeasi f65f289
chore(): add updated snapshots
Ionitron e93d734
feat(input): add wip placement
liamdebeasi 71cec98
chore(): clean up styles
liamdebeasi 3a2e063
test(input): add label placement to a11y test
liamdebeasi d3d10db
test(input): add label placement template
liamdebeasi 9ac44c1
fix(input): adjust input sizing for platform specs
liamdebeasi b2f5879
test(input): add tests for label placement
liamdebeasi 55092f1
Merge remote-tracking branch 'origin/2591-counter' into 2591-placement
liamdebeasi 661be60
chore(): add updated snapshots
Ionitron 786e3ea
test(input): add base fill html
liamdebeasi 6b8131a
Update core/src/components/input/input.tsx
liamdebeasi e0b5cd6
feat(input): add missing fill property
liamdebeasi 5a0f812
refactor(): explicitly add element type
liamdebeasi 2bf7b10
test(input): mask test uses new syntax
liamdebeasi 1cc337a
refactor(input): access props once
liamdebeasi 9f04dd1
Merge branch '2591-base' into 2591-helper
liamdebeasi 4272366
chore(): fix el type
liamdebeasi 6d09ad6
Merge remote-tracking branch 'origin/2591-props' into 2591-template
liamdebeasi 9632c22
Merge remote-tracking branch 'origin/2591-template' into 2591-base
liamdebeasi 79ff704
Merge remote-tracking branch 'origin/2591-base' into 2591-helper
liamdebeasi aa7edae
Merge remote-tracking branch 'origin/2591-helper' into 2591-counter
liamdebeasi 15b1ab6
chore(): sync
liamdebeasi 40e2e54
Merge remote-tracking branch 'origin/2591-placement' into 2591-fill
liamdebeasi fe20efa
feat(input): add base solid + shape implementation
liamdebeasi 7670a27
chore(): padding is set on wrapper
liamdebeasi 0a66283
chore(): use mixin
liamdebeasi 9d13fbe
Merge remote-tracking branch 'origin/2591-placement' into 2591-fill
liamdebeasi 3408223
fix(input): padding applied to input wrapper
liamdebeasi 21f32a1
chore(): sync
liamdebeasi 9d77a37
chore(): border radius is set on native input for legacy
liamdebeasi bf7d77c
fix(input): bottom is adjusted for padding
liamdebeasi c87f89b
chore(): add more examples
liamdebeasi 10d2af3
fix(input): fixed label does not have end margin
liamdebeasi d4ff322
Merge remote-tracking branch 'origin/2591-placement' into 2591-fill
liamdebeasi 056c4f4
chore(): test clean up
liamdebeasi 71a9bdb
chore(): deprecate fill and shape on item
liamdebeasi 9e1ce71
chore(): lint
liamdebeasi 18662d1
test(input): add solid tests
liamdebeasi db83b9f
chore(): lint
liamdebeasi 0dceaf6
chore(): add updated snapshots
Ionitron 629f189
refactor(input): label container is now rendered in separate fn
liamdebeasi f3582fa
test(input): add more outline examples
liamdebeasi cc209d5
feat(input): first pass at outline style
liamdebeasi 4af53c3
fix(input): shaped outline has correct padding
liamdebeasi 5406b62
test(input): add more examples
liamdebeasi 24626dc
chore(): update test file
liamdebeasi a6149ff
test(input): add outline tests
liamdebeasi 9c52ef7
fix(input): bottom input padding is now correct
liamdebeasi c7d26e9
test(input): update a11y test
liamdebeasi b619254
fix(input): resolve a11y issues with outline style
liamdebeasi 3803513
chore(): clean up, comments
liamdebeasi f1927bb
chore(): add updated snapshots
Ionitron e676edc
refactor(input): begin work on input taking up full container
liamdebeasi b167b01
Merge branch '2591-fill' of https://github.com/ionic-team/ionic-frame…
liamdebeasi 21820dd
Revert "chore(): add updated snapshots"
liamdebeasi 49c7563
refactor(input): move label class to host
liamdebeasi c4ad092
chore(): sync
liamdebeasi fbfd775
fix(input): inputs now take up full container
liamdebeasi a85ca3b
Revert "chore(): add updated snapshots"
liamdebeasi e58033b
fix(input): adjust size and label offset
liamdebeasi 7e9849a
Merge remote-tracking branch 'origin/2591-placement' into 2591-fill
liamdebeasi f2c6c42
chore(): add updated snapshots
Ionitron 04e17bb
chore(): add updated snapshots
Ionitron d825070
refactor(input): split css out into separate files, add comments
liamdebeasi 8bc3bc8
chore(): add empty line
liamdebeasi ea608fa
Merge branch '2591-fill' of https://github.com/ionic-team/ionic-frame…
liamdebeasi 6de0562
chore(): revert padding fix
liamdebeasi 474366a
Revert "chore(): add updated snapshots"
liamdebeasi 9ded038
Merge remote-tracking branch 'origin/2591-placement' into 2591-fill
liamdebeasi d5d1947
chore(): add updated snapshots
Ionitron 4e86dea
Revert "chore(): add updated snapshots"
liamdebeasi 26976e8
fix(input): remove bottom border from normal input
liamdebeasi a14c6b7
chore(): add updated snapshots
Ionitron 1584994
fix(input): outline border thickens on focus
liamdebeasi ecad98e
Merge branch '2591-fill' of https://github.com/ionic-team/ionic-frame…
liamdebeasi 64b53fc
Revert "chore(): add updated snapshots"
liamdebeasi 9f98f60
chore(): add updated snapshots
Ionitron 0c85bb1
test(input): fix shape naming
liamdebeasi 570d4de
Revert "chore(): add updated snapshots"
liamdebeasi 6226556
chore(): add updated snapshots
Ionitron c0d97b2
chore(): sync
liamdebeasi f6f37eb
Merge remote-tracking branch 'origin/FW-2591' into 2591-fill
liamdebeasi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| // Input Fill: Outline | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.input-fill-outline) { | ||
| --border-color: #{$background-color-step-300}; | ||
| --border-radius: 4px; | ||
| --padding-start: 16px; | ||
| --padding-end: 16px; | ||
| } | ||
|
|
||
| :host(.input-fill-outline.input-shape-round) { | ||
| --border-radius: 9999px; | ||
| --padding-start: 32px; | ||
| --padding-end: 32px; | ||
| } | ||
|
|
||
| /** | ||
| * The border should get thicker when | ||
| * the input is focused. | ||
| */ | ||
| :host(.input-fill-outline.has-focus) { | ||
| --border-width: 2px; | ||
| } | ||
|
|
||
| /** | ||
| * The bottom content should never have | ||
| * a border with the outline style. | ||
| */ | ||
| :host(.input-fill-outline) .input-bottom { | ||
| border-top: none; | ||
| } | ||
|
|
||
| /** | ||
| * Border should be | ||
| * slightly darker on hover. | ||
| */ | ||
| @media (any-hover: hover) { | ||
| :host(.input-fill-outline:hover) { | ||
| --border-color: #{$background-color-step-750}; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Outline inputs do not have a bottom border. | ||
| * Instead, they have a border that wraps the | ||
| * input + label. | ||
| */ | ||
| :host(.input-fill-outline) .input-wrapper { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| :host(.input-fill-outline.input-label-placement-stacked) label, | ||
| :host(.input-fill-outline.input-label-placement-floating) label { | ||
| @include transform-origin(center, top); | ||
| } | ||
|
|
||
| /** | ||
| * The label should appear on top of an outline | ||
| * container that overlaps it so it is always clickable. | ||
| */ | ||
| :host(.input-fill-outline) label, | ||
| :host(.input-fill-outline) label { | ||
| position: relative; | ||
|
|
||
| z-index: 1; | ||
| } | ||
|
|
||
| /** | ||
| * This makes the label sit above the input. | ||
| */ | ||
| :host(.has-focus.input-fill-outline.input-label-placement-floating) label, | ||
| :host(.has-value.input-fill-outline.input-label-placement-floating) label, | ||
| :host(.input-fill-outline.input-label-placement-stacked) label, | ||
| :host(.input-fill-outline.input-label-placement-stacked) label { | ||
| @include transform(translateY(-32%), scale(.75)); | ||
| @include margin(0); | ||
| } | ||
|
|
||
| /** | ||
| * This ensures that the input does not | ||
| * overlap the floating label while still | ||
| * remaining visually centered. | ||
| */ | ||
| :host(.input-fill-outline.input-label-placement-stacked) input, | ||
| :host(.input-fill-outline.input-label-placement-floating) input { | ||
| @include margin(6px, 0, 6px, 0); | ||
| } | ||
|
|
||
| // Input Fill: Outline Outline Container | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.input-fill-outline) .input-outline-container { | ||
| @include position(0, 0, 0, 0); | ||
|
|
||
| display: flex; | ||
|
|
||
| position: absolute; | ||
|
|
||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| :host(.input-fill-outline) .input-outline-start, | ||
| :host(.input-fill-outline) .input-outline-end { | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| /** | ||
| * By default, each piece of the container should have | ||
| * a top and bottom border. This gives the appearance | ||
| * of a unified container with a border. | ||
| */ | ||
| :host(.input-fill-outline) .input-outline-start, | ||
| :host(.input-fill-outline) .input-outline-notch, | ||
| :host(.input-fill-outline) .input-outline-end { | ||
| border-top: var(--border-width) var(--border-style) var(--border-color); | ||
| border-bottom: var(--border-width) var(--border-style) var(--border-color); | ||
| } | ||
|
|
||
| :host(.input-fill-outline) .input-outline-start { | ||
| @include border-radius(var(--border-radius), 0px, 0px, var(--border-radius)); | ||
| @include border(null, null, null, var(--border-width) var(--border-style) var(--border-color)); | ||
|
|
||
| width: 12px; | ||
| } | ||
|
|
||
| /** | ||
| * When shape="round", the starting outline fragment | ||
| * should appear with a pill shape. | ||
| */ | ||
| :host(.input-fill-outline.input-shape-round) .input-outline-start { | ||
| @include border-radius(28px, 0px, 0px, 28px); | ||
| width: 28px; | ||
| } | ||
|
|
||
| :host(.input-fill-outline) .input-outline-end { | ||
| @include border(null, var(--border-width) var(--border-style) var(--border-color), null, null); | ||
| @include border-radius(0px, var(--border-radius), var(--border-radius), 0px); | ||
|
|
||
| /** | ||
| * The ending outline fragment | ||
| * should take up the remaining free space. | ||
| */ | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| /** | ||
| * When the input either has focus or a value, | ||
| * there should be a "cut out" at the top for | ||
| * the floating/stacked label. We simulate this "cut out" | ||
| * by removing the top border from the notch fragment. | ||
| */ | ||
| :host(.has-focus.input-fill-outline.input-label-placement-floating) .input-outline-notch, | ||
| :host(.has-value.input-fill-outline.input-label-placement-floating) .input-outline-notch, | ||
| :host(.input-fill-outline.input-label-placement-stacked) .input-outline-notch, | ||
| :host(.input-fill-outline.input-label-placement-stacked) .input-outline-notch { | ||
| border-top: none; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Input Fill: Solid | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.input-fill-solid) { | ||
| --background: #{$background-color-step-50}; | ||
| --border-color: #{$background-color-step-500}; | ||
| --border-radius: 4px; | ||
| --padding-start: 16px; | ||
| --padding-end: 16px; | ||
| } | ||
|
|
||
| /** | ||
| * The solid fill style has a border | ||
| * at the bottom of the input wrapper. | ||
| * As a result, the border on the "bottom | ||
| * content" is not needed. | ||
| */ | ||
| :host(.input-fill-solid) .input-wrapper { | ||
| border-bottom: var(--border-width) var(--border-style) var(--border-color); | ||
| } | ||
|
|
||
| :host(.input-fill-solid) .input-bottom { | ||
| border-top: none; | ||
| } | ||
|
|
||
| /** | ||
| * Background and border should be | ||
| * slightly darker on hover. | ||
| */ | ||
| @media (any-hover: hover) { | ||
| :host(.input-fill-solid:hover) { | ||
| --background: #{$background-color-step-100}; | ||
| --border-color: #{$background-color-step-750}; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Background and border should be | ||
| * much darker on focus. | ||
| */ | ||
| :host(.input-fill-solid.has-focus) { | ||
| --background: #{$background-color-step-150}; | ||
| --border-color: #{$background-color-step-750}; | ||
| } | ||
|
|
||
| :host(.input-fill-solid) .input-wrapper { | ||
| /** | ||
| * Only the top left and top right borders should. | ||
| * have a radius when using a solid fill. | ||
| */ | ||
| @include border-radius(var(--border-radius), var(--border-radius), 0px, 0px); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.