Commit Graph

108 Commits

Author SHA1 Message Date
Elizabeth Mitchell
2b02497a25 chore(switch): remove comment on button content
PiperOrigin-RevId: 629418950
2024-04-30 08:21:08 -07:00
Copybara-Service
2ae226cf17 Merge pull request #5501 from vdegenne:switch-input-event
PiperOrigin-RevId: 614856943
2024-03-11 18:02:40 -07:00
vdegenne
771702edce chore: remove unnecessary code 2024-03-11 16:19:11 +01: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
vdegenne
e46fc6ddf9 chore(switch): add test unit 2024-02-28 14:26:18 +01:00
vdegenne
8d201e0d5d fix(switch): reflect selected state in input event 2024-02-28 11:50:06 +01: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
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
de37349ec5 chore: fix demo a11y for switch and checkbox
PiperOrigin-RevId: 556113327
2023-08-11 15:30:26 -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
Elliott Marquez
86ccec3e7e build: use firebase for hosting and remove url prefixes 2023-07-27 09:17:27 -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
Elizabeth Mitchell
d49f9b89e4 fix(focus)!: rename import to md-focus-ring.ts
BREAKING CHANGE: Change `@material/web/focus/focus-ring.js` to `@material/web/focus/md-focus-ring.js`.

PiperOrigin-RevId: 550608428
2023-07-24 10:43:31 -07:00
Elizabeth Mitchell
243e231a13 feat(all): expose focus-ring parts
PiperOrigin-RevId: 548873009
2023-07-17 20:28:04 -07:00
Elizabeth Mitchell
fd28dd1a5b chore(all): move focus tokens to focus ring element
PiperOrigin-RevId: 548872335
2023-07-17 20:24:46 -07:00
Andrew Jakubowicz
a8e489e2d8 fix(switch)!: change showonlyselectedicon to show-only-selected-icon
PiperOrigin-RevId: 542412707
2023-06-21 17:55:56 -07:00
Elizabeth Mitchell
1790a5bbf8 chore: remove closure comments from static blocks
PiperOrigin-RevId: 539772537
2023-06-12 15:07:36 -07:00
Elizabeth Mitchell
0607d9ca53 chore: fix jscompiler issues
PiperOrigin-RevId: 539716693
2023-06-12 11:42:52 -07:00
Elizabeth Mitchell
2434257086 chore: update annotations after closure extern fixes
PiperOrigin-RevId: 537935481
2023-06-05 11:34:43 -07:00
Elizabeth Mitchell
b9daa95164 chore(controller): move to internal
PiperOrigin-RevId: 536574896
2023-05-30 19:43:02 -07:00
Elizabeth Mitchell
abb98eb983 chore: fix closure issues with FACE
PiperOrigin-RevId: 536495179
2023-05-30 13:35:07 -07:00
Elizabeth Mitchell
5efdc593fa chore(aria): move to internal
PiperOrigin-RevId: 536444453
2023-05-30 10:37:46 -07:00
Elizabeth Mitchell
7c08efdd66 chore(all): remove ripple directive
PiperOrigin-RevId: 535647846
2023-05-26 10:06:39 -07:00
Elizabeth Mitchell
933fc2e013 fix(all): remove focus state layer tokens
BREAKING CHANGE: Remove any *-focus-state-layer-* custom properties (they don't do anything)

PiperOrigin-RevId: 535302944
2023-05-25 10:33:20 -07:00
Elizabeth Mitchell
b69e24241e fix(ripple)!: remove unbounded
BREAKING CHANGE: Set `border-radius: 50%` and remove `unbounded` attribute

PiperOrigin-RevId: 535301943
2023-05-25 10:30:22 -07:00
Elizabeth Mitchell
a6c988bedd fix(ripple)!: remove shape token and will-change
BREAKING CHANGE: Use `border-radius` instead of `--md-ripple-shape`

PiperOrigin-RevId: 535034875
2023-05-24 17:14:12 -07:00
Elizabeth Mitchell
c1ba0fb3b6 fix: formAssociated being stripped from closure
PiperOrigin-RevId: 534091935
2023-05-22 09:36:29 -07:00
Elizabeth Mitchell
921a905758 feat(switch): add full form association support
PiperOrigin-RevId: 532627572
2023-05-16 17:58:23 -07:00