Commit Graph

24 Commits

Author SHA1 Message Date
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
a2721c39d4 refactor(switch): reduce CSS size
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.

Size before: 14,615b / 2,327b gzip
Size after: 10,802 (-26%) / 1,865b gzip (-20%)

PiperOrigin-RevId: 600918909
2024-01-23 15:06:24 -08:00
Elizabeth Mitchell
eca1357f1a fix: rename and move internal/controller/events
Split `internal/controller/events` into `internal/events/redispatch-event` and `internal/events/form-label-activation`

PiperOrigin-RevId: 592350371
2023-12-19 14:49:35 -08:00
Elizabeth Mitchell
2bb480fb82 chore: move events out of controller folder
PiperOrigin-RevId: 592021123
2023-12-18 15:07:51 -08:00
Copybara-Service
77fd17787f Merge pull request #5241 from mavyfaby:switch-icon-slots
PiperOrigin-RevId: 586825469
2023-11-30 16:41:39 -08:00
Maverick Fabroa
7bdf63e92d
refactor(switch): reduce code by using fill: currentColor 2023-12-01 06:45:10 +08:00
Maverick Fabroa
3ef4b3137c
refactor(switch): remove unwanted spaces 2023-12-01 06:38:20 +08:00
mavyfaby
9255be1be5 feat(switch): add slot icons 2023-12-01 01:06:58 +08:00
Elizabeth Mitchell
f7a66a8bbe refactor: add constraint validation mixin
This reduces the copy/paste of validation code. Constraint validation must be synchronous, so a `Validator` helps compute the validity and cache it since the validity must be checked when properties change.

Implemented in checkbox-like controls.

PiperOrigin-RevId: 584380464
2023-11-21 11:22:03 -08:00
Elizabeth Mitchell
8eb1f30e6f refactor: add checkbox validator
Part of adding constraint validation mixins. Each component that participates in constraint validation has different rules and error messages for validating. The `Validator` gives `mixinConstraintValidation()` a way to compute and cache validation.

Other validators will be added later, such as `SelectValidator` and `RadioValidator`

PiperOrigin-RevId: 583508468
2023-11-17 15:59:38 -08:00
Elizabeth Mitchell
1f55d4111f chore(behaviors): update form controls to use shared mixins
PiperOrigin-RevId: 578297611
2023-10-31 14:08:39 -07:00
Elizabeth Mitchell
c390291687 chore: format files with prettier
PiperOrigin-RevId: 576601342
2023-10-25 11:59:00 -07:00
Elliott Marquez
9a3ff289f5 fix(switch): cursor should be pointer except when disabled
fixes #5075

PiperOrigin-RevId: 574526749
2023-10-18 10:54:34 -07:00
Elizabeth Mitchell
b3c9c3a336 chore(switch): merge hcm styles
PiperOrigin-RevId: 570543360
2023-10-03 17:30:01 -07:00
Elizabeth Mitchell
c26a578448 fix(textfield): broken required validity on Safari
Fixes #4796

PiperOrigin-RevId: 564562802
2023-09-11 18:39:59 -07:00
Elizabeth Mitchell
0e8afc0175 fix: ripple and focus ring not centered in Safari
PiperOrigin-RevId: 559826221
2023-08-24 12:00:23 -07:00
Elizabeth Mitchell
9694191ec0 feat(switch): add required and form validity
Swapped switch's interactive element back to an `<input>` to more easily support platform validation messages.

PiperOrigin-RevId: 559671594
2023-08-24 00:54:57 -07:00
Elizabeth Mitchell
3e13634d64 chore: make formAssociated readonly
PiperOrigin-RevId: 558255234
2023-08-18 14:57:38 -07:00
Elizabeth Mitchell
ecf83a0e7a fix(switch): unselected handle too big with selected icon only
PiperOrigin-RevId: 557923981
2023-08-17 13:43:10 -07:00
Elizabeth Mitchell
8bad07bcf7 feat(switch): add touch target configs
PiperOrigin-RevId: 556012902
2023-08-11 10:54:09 -07:00
Elizabeth Mitchell
0510496e60 chore: avoid this in static context
PiperOrigin-RevId: 554933524
2023-08-08 14:00:25 -07:00
Elizabeth Mitchell
3681b588e0 fix(switch)!: remove unselected token prefix
BREAKING CHANGE: Rename `--md-switch-unselected-<token>` to `--md-switch-<token>`

PiperOrigin-RevId: 552339215
2023-07-30 19:44:14 -07:00
Andrew Jakubowicz
6ec3f06429 fix!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/<component>/lib` to `@material/web/<component>/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550633216
2023-07-24 12:02:59 -07:00