Commit Graph

90 Commits

Author SHA1 Message Date
Copybara-Service
c5e87b23a1 Merge pull request #5616 from npeters-dev:text-field-optional-asterisk
PiperOrigin-RevId: 636585863
2024-05-23 10:02:19 -07:00
Nino Peters
be5bb43100 feat(textfield): make required asterisk optional 2024-05-15 10:44:20 +02:00
Elizabeth Mitchell
c35bad0c64 fix: rename internal <styles>.css.js to <styles>.css
We are changing the names of these files to reduce similarity with CSS modules and avoid clashing with tooling built around that. If you're importing `*/internal/styles.css.js`, swap to `*/internal/styles.js`.

PiperOrigin-RevId: 611265000
2024-02-28 16:20:22 -08:00
Elizabeth Mitchell
ec0a8ebf6e chore: use CSSResultOrNative instead of CSSResult for static styles
PiperOrigin-RevId: 609760445
2024-02-23 10:01:56 -08:00
Elizabeth Mitchell
ce41b7bfb3 fix: use explicit CSSResult[] types for static styles
PiperOrigin-RevId: 609494809
2024-02-22 14:15:11 -08:00
Elizabeth Mitchell
09f620de55 chore(field): remove obsolete design todo question
PiperOrigin-RevId: 609065119
2024-02-21 11:27:49 -08:00
Elizabeth Mitchell
f2ff86725c fix: remove :host-context rtl selectors
We can support this now that Chrome 120-121 are stable.

PiperOrigin-RevId: 606984234
2024-02-14 07:53:51 -08:00
Elizabeth Mitchell
5e40a1bcec chore: create shape logical tokens in Sass component token files
Adds `@material/web/tokens/internal/shape` to take a shape token and create 4 logical tokens from its value.

All components' logical shape tokens are now generated by the token files themselves, rather than added in each component's styles.

PiperOrigin-RevId: 601783846
2024-01-26 09:13:58 -08:00
Elizabeth Mitchell
84536d7416 chore: update components to use custom properties from tokens
PiperOrigin-RevId: 601597083
2024-01-25 16:13:41 -08:00
Elizabeth Mitchell
9973b90981 fix(textfield): counter showing when max length is 0 or removed
Fixes #4998

This also fixes an error being thrown in text field's validator when minlength/maxlength change to out of bounds if they're not set in the correct order.

PiperOrigin-RevId: 594013553
2023-12-27 08:13:58 -08:00
vdegenne
4fce487c81 fix(text-field): wrap text in textarea 2023-11-29 20:19:51 +01:00
Elizabeth Mitchell
87dfee41af chore(field): reduce HCM styles and move from textfield/select to field
PiperOrigin-RevId: 578351982
2023-10-31 17:33:28 -07:00
Elizabeth Mitchell
c390291687 chore: format files with prettier
PiperOrigin-RevId: 576601342
2023-10-25 11:59:00 -07:00
Elizabeth Mitchell
9194cc94db fix(textfield): missing focused left border for textarea in HCM
PiperOrigin-RevId: 569336619
2023-09-28 17:36:12 -07:00
Andrew Jakubowicz
448fcddfa2 chore: decouple field component from interface imported from menu
PiperOrigin-RevId: 567361278
2023-09-21 11:09:34 -07:00
Elizabeth Mitchell
7866a939b9 fix(textfield): add demo a11y and fix outlined label navigation
PiperOrigin-RevId: 565191993
2023-09-13 16:19:47 -07:00
Elizabeth Mitchell
61c8f6db46 fix(textfield): don't show focus indicator when focused on icon
PiperOrigin-RevId: 564527586
2023-09-11 16:01:43 -07:00
Elizabeth Mitchell
0c5a2a2886 fix(text-field,select): remove font shorthand tokens
BREAKING CHANGE: replace `*-type` font tokens with `-font`, `-size`, `-line-height`, and `-weight`

PiperOrigin-RevId: 563160975
2023-09-06 11:18:59 -07:00
Elizabeth Mitchell
cdd2ea6c1d fix(textfield): textarea resize handle overlapping outline
PiperOrigin-RevId: 562022448
2023-09-01 12:37:14 -07:00
Elizabeth Mitchell
ecac7ecbad fix(textfield): show overflowing content like popups and focus rings
Fixes #4071

Note: Right now textareas cannot display overflowing content due to `resize` requiring hidden overflow.

BREAKING CHANGE: The field component must add the `resizable` attribute rather than using CSS. CSS `resize` can still customize the direction (defaults to both).

PiperOrigin-RevId: 561981406
2023-09-01 09:57:57 -07:00
Elizabeth Mitchell
11cc4721ce fix(textfield): don't transition colors when disabling
PiperOrigin-RevId: 561801775
2023-08-31 17:12:30 -07:00
Elizabeth Mitchell
541c0e947d fix(textfield): line breaks not visible in Firefox
Fixes #4581

PiperOrigin-RevId: 561168215
2023-08-29 16:20:46 -07:00
Elliott Marquez
86ccec3e7e build: use firebase for hosting and remove url prefixes 2023-07-27 09:17:27 -07:00
Andrew Jakubowicz
a8c2fa9a8b fix(menu)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/menu/lib` to `@material/web/menu/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550589890
2023-07-24 09:45:01 -07:00
Andrew Jakubowicz
dac3639721 fix(field)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/field/lib` to `@material/web/field/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550049784
2023-07-21 14:24:05 -07:00
Elizabeth Mitchell
ff2e089680 feat(textfield): add textarea type
Fixes #4171, #1305, #2926

Changes:
- Added "textarea" type (matches native <textarea>, which has a "type" property like `<input>`)
- Moved pointer-events to the label wrapper so it wouldn't overlap content
- Made resizable field respect min-height
- Remove resize handle when field is disabled
PiperOrigin-RevId: 549104722
2023-07-18 14:02:02 -07:00
Elizabeth Mitchell
398204676e chore(field): rename label wrapper class
PiperOrigin-RevId: 548172351
2023-07-14 11:10:34 -07:00
Elizabeth Mitchell
7fdd0c4c31 fix(field): use margin for textarea content
PiperOrigin-RevId: 548159696
2023-07-14 10:25:00 -07:00
Elizabeth Mitchell
e1f881991a fix(field): keep label in same spot when resizing
PiperOrigin-RevId: 547572280
2023-07-12 12:39:18 -07:00
Elizabeth Mitchell
6734344e73 fix(field)!: remove resizable, use css resize: both
PiperOrigin-RevId: 547567087
2023-07-12 12:19:15 -07:00
Elizabeth Mitchell
0ab5fd595d fix(field): move padding to slotted content
PiperOrigin-RevId: 547375880
2023-07-11 21:01:24 -07:00
Elizabeth Mitchell
86aba33dea fix(textfield)!: rename container-padding-vertical tokens
BREAKING CHANGE: Rename `--md-*-field-container-padding-vertical` to `--md-*-field-top-space` and `--md-*-field-bottom-space`. Rename `--md-filled-*-field-with-label-container-padding-vertical` to `--md-filled-*-field-with-label-top-space` and `--md-filled-*-field-with-label-bottom-space`

PiperOrigin-RevId: 547278912
2023-07-11 13:21:57 -07:00
Elizabeth Mitchell
447886da2e fix(textfield)!: rename container-padding-horizontal token
BREAKING CHANGE: Rename `--md-*-field-container-padding-horizontal` to `--md-*-field-leading-space` and `--md-*-field-trailing-space`

PiperOrigin-RevId: 547222914
2023-07-11 10:08:03 -07:00
Elizabeth Mitchell
4f37b4474f fix(textfield)!: rename supporting-text-padding tokens
BREAKING CHANGE: Rename `--md-*-field-supporting-text-padding` to `--md-*-field-supporting-text-leading-space` and `--md-*-field-supporting-text-trailing-space`. Rename `--md-*-field-supporting-text-padding-top` to `--md-*-field-supporting-text-top-space`

PiperOrigin-RevId: 547218344
2023-07-11 09:52:25 -07:00
Elizabeth Mitchell
b4b3e67ae6 feat(field): add supporting/error text logic
PiperOrigin-RevId: 546111440
2023-07-06 15:42:43 -07:00
Elizabeth Mitchell
6762b00588 fix(textfield): make label strict string type
PiperOrigin-RevId: 545784105
2023-07-05 14:18:13 -07:00
Andrew Jakubowicz
2937aefa23 fix(field)!: change compound attribute names to kebab-case
BREAKING_CHANGE: Attributes `hasstart` and `hasend` have been changed to `has-start` and `has-end` respectively.
PiperOrigin-RevId: 542626280
2023-06-22 11:57:20 -07:00
Elizabeth Mitchell
ed00d30b1d chore(motion): move to internal
PiperOrigin-RevId: 536448206
2023-05-30 10:50:00 -07:00
Elliott Marquez
dc49e0b518 docs: update playground urls to match new base-URI
PiperOrigin-RevId: 531322264
2023-05-11 15:24:11 -07:00
Elliott Marquez
b6ae8268a2 refactor: fix stories links
PiperOrigin-RevId: 531019393
2023-05-10 15:23:08 -07:00
Elliott Marquez
1cade43ccf refactor: remove extraneous file extensions
PiperOrigin-RevId: 530993820
2023-05-10 14:04:53 -07:00
Elizabeth Mitchell
b9e3afc2b7 chore(textfield): remove shape resolver
PiperOrigin-RevId: 528529823
2023-05-01 11:40:17 -07:00
Daniel Freedman
9ce10bc100 chore(all): remove unnecessary property typing for strings
PiperOrigin-RevId: 523201301
2023-04-10 13:43:10 -07:00
Elizabeth Mitchell
f15d8ca2fa fix(textfield): tonal surface update
PiperOrigin-RevId: 522243926
2023-04-05 22:02:19 -07:00
Elizabeth Mitchell
3934f51e1d chore(tokens): update default to v0.172
PiperOrigin-RevId: 522134400
2023-04-05 13:12:02 -07:00
Material Web Team
533ae6c999 feat(field,menu): create a surface client rect api for positioning
Expose the field container element to allow anchoring directly to it. This is necessary because if there is supporting text below the field, anchoring a menu to the md-field will cause the menu to anchor below the supporting text which would require some manual pixel-offsets to align correctly.

PiperOrigin-RevId: 516636675
2023-03-14 14:38:55 -07:00
Elizabeth Mitchell
c98f5e017d fix(textfield): outlined label jumping horizontally with leading icon
PiperOrigin-RevId: 513028108
2023-02-28 13:45:10 -08:00
Elizabeth Mitchell
fd605d537c feat(field): add resizability
PiperOrigin-RevId: 512747965
2023-02-27 15:27:57 -08:00
Elizabeth Mitchell
b310e6b9e6 test(text-field): add token tests
PiperOrigin-RevId: 512659469
2023-02-27 10:09:10 -08:00
Elizabeth Mitchell
a969fdadb6 fix(text-field): apply suffix-color and icon size tokens
Text field changes:
- Fixed suffix color token not applying
- Fixed icon size tokens not applying
- Remove redundant styles with field changes

Field changes:
- Added content-type token for inheriting font
- Added leading/trailing content color tokens for icons
- Update field token values functions to be easier to grok all tokens
- Remove container-height token
- Update screenshots for new tokens

PiperOrigin-RevId: 512652818
2023-02-27 09:44:41 -08:00