95 Commits

Author SHA1 Message Date
703f765482 feat(theming): add new color variant for the ionic theme 2024-11-12 11:32:22 -05:00
32fb17cf6e refactor(button): add ripple effect to ionic theme (#29754)
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
2024-08-12 14:30:31 -07:00
4dae03f2ac feat(button): set default shape to soft for ios and round for md and ionic themes (#29404)
Issue number: internal

---------

## What is the current behavior?
The `shape` property defaults to `"soft"` for `ios` and `"round"` for
the `md` and `ionic` themes.

**Default button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------ | ----------- | ----------- |
| `undefined`     | `8px`  | `14px`      | `4px`      |
| `"round"`       | `999px` | unsupported | unsupported |
| `"rectangular"` | `0px`  | unsupported | unsupported |

**Large button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------ | ----------- | ----------- |
| `undefined`     | `8px`  | `16px`      | `4px`      |

**Small button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------ | ----------- | ----------- |
| `undefined`     | `4px`  | `6px`      | `4px`      |

## What is the new behavior?
The `shape` property defaults to `undefined` which evaluates to the
"Soft" shape for all themes.


**Default button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------- | ------ | -------- |
| `"soft"`        | `8px`   | `6px`   | `4px`   |
| `"round"`       | `999px` | `999px` | `999px` |
| `"rectangular"` | `0px`   | `0px`   | `0px`   |

**Large button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------ | ----------- | ----------- |
| `soft`     | `8px`  | `8px`      | `4px`      |

**Small button size**:

| Property Value | CSS Value (`ionic`) | CSS Value (`ios`) | CSS Value
(`md`) |
| --------------- | ------ | ----------- | ----------- |
| `soft`     | `4px`  | `4px`      | `4px`      |

- Adds support for the `"soft"` shape in the `ionic` theme using the
existing values for `undefined`
- Adds support for the `"rectangular"` and `"round"` shapes in `ios` and
`md` using `0px` and `999px` border radius
- Sets the default shape property to `"round"` for the `ionic` and `md`
themes and `"soft"` for `ios` and updates the `border-radius` to apply
to the shape classes instead of `:host`
- Updates the `"soft"` shape border radius for `ios` in the various
sizes to match the buttons created in SwiftUI (their "rounded" is our
"soft"):

![rounded-ios-buttons](https://github.com/ionic-team/ionic-framework/assets/6577830/230edf21-de68-4c41-9b89-8ea310ce42f2)
- Fixed the icon only buttons in the `"ionic"` theme so that they are
not styled based on the size while always following the proper aspect
ratio. This was broken for the default size due to an incorrect padding
value & I made it so we don't have to specify the padding for each size:

| Before | After |
| ---| ---|
|
![before](https://github.com/ionic-team/ionic-framework/assets/6577830/1e8d1a82-ad58-4372-be69-09175362c810)
|
![after](https://github.com/ionic-team/ionic-framework/assets/6577830/06cf6e22-a606-4ccc-ae4b-df69cf9c1e1e)
|

## Does this introduce a breaking change?

- [x] Yes
- [ ] No

BREAKING CHANGE:

The `border-radius` of the `ios` and `md` button now defaults to `6px`
and `999px` instead of `14px` and `4px`, respectively, in accordance
with the iOS and Material Design 3 guidelines. To revert to the previous
appearance, set the `shape` to `"soft"` for `md` and override the
`--border-radius` CSS variable for `ios` to `14px`, or set it to a
different value entirely.

---------

Co-authored-by: ionitron <hi@ionicframework.com>
2024-05-08 16:05:59 -04:00
7eae6ec591 refactor(button): update focus ring to avoid additional API (#29223) 2024-03-26 13:40:11 -04:00
4cf1b9737d feat(button): add ionic theme implementation (#29187)
Issue number: **ROU-4815**

---------

## What is the new behavior?

- Adds an ionic theme style implementation for `ion-button`.
  - Adds a new `rectangular` shape to the button.
  - Adds two new button sizes: `xsmall` and `xlarge`.
  - Adds a new `focus-ring` CSS shadow part for the ionic theme.

## Does this introduce a breaking change?

- [ ] Yes
- [X] No


## Preview


![Screen-Recording-2024-03-20-at-1](https://github.com/ionic-team/ionic-framework/assets/5339917/0defd1b4-abd9-44bc-b0b9-cd29e0b1f24f)

---------

Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandy@ionic.io>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Sean Perkins <sean@ionic.io>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Co-authored-by: João Ferreira <60441552+JoaoFerreira-FrontEnd@users.noreply.github.com>
Co-authored-by: João Ferreira <joao.manuel.ferreira123@gmail.com>
2024-03-25 22:17:10 -04:00
d73de9194d Merge remote-tracking branch 'origin/feature-8.0' into sp/sync-next-03-21 2024-03-21 16:28:35 -04:00
44529f0a62 feat(button): add circular shape as round (#29161)
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
2024-03-21 11:49:26 -07:00
284eb8ecaf feat: add ionic theme architecture (#29132)
Issue number: Internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

Adds the base architecture to add a new theme configuration to Ionic
Framework components.
- Components can now specify an additional stylesheet for the `ionic`
theme.
- Developers can specify the `theme` and `mode` independently to control
look and feel of a component.

Test infrastructure has been updated to add support for testing the
theme configuration with Playwright.
- Existing `themes` test configuration has been renamed to `palettes`

This PR is just the initial effort to decouple Ionic's architecture to
separate look and feel and allow our dev team to start introducing the
new component appearance to the UI. There will be additional changes
required to completely add support for the Ionic theme. These changes
are targeted against the `next` branch and are not expected to be used
in a production environment at this time.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
2024-03-18 15:45:01 -04:00
6bcefcd9ed docs(button): add comments to renderHiddenButton (#28017)
As part of our incident learning review, the team would like to add
better documentation as to the purpose of `renderHiddenButton` for
future reference.
2023-08-17 17:04:01 +00:00
e9fa30002b fix(button): hidden button is added when form is set async (#27955)
Issue number: resolves #27952

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

The hidden button in `ion-button` that is responsible for submitting the
form does not get added when the `form` property is set async.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `ion-button` now checks to see if it needs to render a hidden button
whenever it re-renders. This allows it to account for changes to the
`type` property, `form` property, etc.

Since this code can potentially run multiple times I added an extra
check so we don't add multiple buttons to the form.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.2.3-dev.11691523847.1760ab58`
2023-08-09 14:35:11 +00:00
b78af7598f fix(button): submit form when pressing enter key (#27790)
Issue number: resolves #19368 

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?

The form submits when clicking on the `ion-button`. However, users
cannot submit the form when focused on a form element and pressing the
`enter` button. This does not follow the behavior of the native button
on a form.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Form now submits when a form element is focused and the `enter` button
is pressed.
  - It also submits regardless of the amount of form elements present.
- Form will not submit if the `ion-button` is disabled.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

N/A
2023-07-14 17:24:53 +00:00
0a0345a84a refactor(many): use utils import (#27160) 2023-04-12 13:25:14 -07:00
c85b5308a1 chore(): sync with main 2023-02-08 09:44:42 -05:00
37591255b4 fix(button): size and strong are respected in ion-buttons (#26726)
resolves https://github.com/ionic-team/ionic-framework/issues/16289
2023-02-07 08:44:10 -05:00
1a8bd6d8c6 chore(deps): update to stencil v3 (#26663) 2023-01-31 18:07:22 -05:00
b78b454e08 revert(): revert base components feature (#26692)
The Ionic Framework team would like to re-evaluate our approach to improving customization options when building mobile applications. We are looking at other solutions that a) make customizing an app UI easier and b) are applicable to a broader set of developers.
2023-01-30 11:52:36 -05:00
18f109c7da feat(base-components): add ability to remove ios and md theme (#26669) 2023-01-24 16:18:35 -05:00
2fe23d9d46 fix(button): fill can be set to undefined (#26339)
resolves #25886
2022-11-22 13:46:17 -05:00
b13983848c feat(button): submit from outside of form (#25913)
Resolves #21194

Co-authored-by: Sean Perkins <sean@ionic.io>
2022-09-30 14:10:40 -04:00
0855f8dc79 docs(button): update docs for properties to describe options better (#25940) 2022-09-14 17:55:24 -04:00
611832b0d5 fix(core): inherit aria attributes on host elements (#25156)
Resolves #20127
2022-04-21 10:50:56 -04:00
5676bab316 lint(eslint): migrate to eslint and prettier (#25046) 2022-04-04 11:12:53 -04:00
19ac2389eb fix(img): draggable attribute is now inherited to inner img element (#24781)
Resolves #21325

Co-authored-by: Celilsemi Sam Erkiner <celilsemi@erkiner.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2022-02-21 11:50:57 -05:00
dc430af906 fix(all): reflect color property as an attribute for vue (#23345)
resolves #23323
2021-05-21 19:26:53 -04:00
818e387fe8 fix(button): allow aria-label to be inherited to inner button (#22632)
resolves #22629
2020-12-07 12:31:05 -05:00
c454c84ef4 fix(button): allow any element type to use the "icon-only" slot (#22168) 2020-10-06 18:40:29 -04:00
753fd2f910 chore(colorClass): update createColorClasses() for ts4 (#21896)
Change the createColorClasses() fn so the returned type and jsx class property work well with typescript 4
2020-08-10 09:18:41 -05:00
ae47d77710 chore(api): internal updates required for stencil 2 upgrade (#21889)
Stencil 2 is removing deprecated APIs, and these are the remaining ones Ionic has been using.
2020-08-06 10:33:22 -05:00
17375d2325 feat(all): add shadow parts to missing components (#21436) 2020-06-10 09:58:33 -04:00
f34d3752e3 feat(all): add support for configuring animations on a per-page basis (#21433) 2020-06-08 15:49:14 -04:00
0a33a095f1 chore(button): remove unreleased parts support (#21111) 2020-04-23 12:23:48 -04:00
976e68da5b refactor(): minor updates for next stencil version (#20787) 2020-03-24 11:59:07 -04:00
c1d7bf229d fix(buttons): use proper button colors based on CSS variables when inside of a toolbar (#20633) 2020-02-27 16:22:39 -05:00
94159291b2 feat(components): improve button states and add new css properties (#19440)
Before users had to know the exact opacity that the MD/iOS spec called for in order to change the hover or focused background color. This allows them to change the background without having to know the opacity. 

- changes apply to Action Sheet (Buttons), Back Button, Button, FAB Button, Item, Menu Button, Segment Button, Tab Button
- greatly reduces the requirement by users to set the background hover, focused states for dark modes and custom themes, also eliminates the need to know what the hover opacity is for each based on the spec
- updates the MD dark theme per their spec
- adds a component guide for internal use changing Ionic components

references #18279 fixes #20213 fixes #19965

BREAKING CHANGE:

*Activated Class*

The `activated` class that is automatically added to buttons on press has been renamed to `ion-activated`. This will be more consistent with our `ion-focused` class we add and also will reduce conflicts with user's CSS.

*CSS Variables*

The `--background-hover`, `--background-focused` and `--background-activated` CSS variables on components that render native buttons will now have an opacity automatically set. If you are setting any of these like the following:

```
--background-hover: rgba(44, 44, 44, 0.08);
```

You will likely not see a hover state anymore. It should be updated to only set the desired color:

```
--background-hover: rgba(44, 44, 44);
```

If the opacity desired is something other than what the spec asks for, use:

```
--background-hover: rgba(44, 44, 44);
--background-hover-opacity: 1;
```
2020-01-23 16:57:47 -05:00
5bbb95fae1 feat(list-header): redesign list header for iOS spec (#19915) 2019-11-19 14:53:37 -05:00
34dfc3ce98 refactor(all): updating to newest stencil apis (#18578)
* chore(): update ionicons

* refactor(all): updating to newest stencil apis

* fix lint issues

* more changes

* moreee

* fix treeshaking

* fix config

* fix checkbox

* fix stuff

* chore(): update ionicons

* fix linting errors
2019-06-23 11:26:42 +02:00
b40f7d36d5 fix(): update to Stencil One 🎉🎊 2019-06-19 21:33:50 +02:00
eca4121dc6 feat(components): add missing button/a props to components that render them (#17883)
Adds the following properties to the components listed under them:

`rel`, `download`, `target`:
- anchor
- button
- card
- fab-button
- item-option
- item
- tab-button

`disabled`:
- back-button
- menu-button

`type`:
- back-button
- item-option
- menu-button
- segment-button

fixes #16848 closes #16889


Co-authored-by: bitflower <matthias.max@bitflower.net>
2019-06-12 14:06:29 -04:00
a3e23fc9fa fix(button): use correct size on a dynamic button in an item (#18395)
fixes ##18085
2019-06-10 16:47:32 -04:00
d13983451a fix(button): only apply has-icon-only if icon has the slot for icon-only (#18343)
fixes #18329
2019-05-22 11:28:06 -04:00
fa87e35a05 fix(toolbar): update md toolbar button spacing and padding to match spec (#17537)
- Removes the padding from the main toolbar and individually style the components inside of it
- Adds a `has-icon-only` class to button, this is used to switch between `unbounded` and `bounded` ripples on buttons in a toolbar. If the button is clear and only has an icon, we use the unbounded "circular" ripple effect, otherwise still use the bounded one. This matches the MD spec, without making the other buttons look off.
- Using the class above, style the button differently to match the MD spec
- Updates the back button and menu button to use the proper size / icon size
- Removes the opacity on an activated back button, it should use the ripple for activated
- Moves the margin to the slots in a toolbar by grabbing the "first" and "last" slot and applying a class to them
- Makes the segment in a toolbar use the min height from the toolbar
- Updates the back button so that it matches the MD spec
- Updates the header box shadow to use the old v3 datauri 

fixes #16950 fixes #14444
2019-05-17 14:54:21 -04:00
e5c8c10029 fix(components): include mode classes on components for use in shadow (#17838)
- removes mode-less component classes from the internal CSS, use element instead
- adds mode specific classes `md` or `ios` for styling inside of shadow components
- adds e2e test that verifies mode classes exist on all ionic components, plus checks for specific classes that the components need for internal styling

fixes #17608
2019-04-16 17:28:21 -04:00
4646f53ec7 fix(ssr): fix global window and document references (#17590) 2019-02-22 20:13:09 -06:00
29f1500e5a docs(): Add documentation for slots (#17441)
* add button slot

* add component slot docs

* update content default slot description

* run npm build

* fix typos

* update md files

* docs(slots): update slot components and the build files

* chore(stencil): updates stencil to build readmes

* chore(build): update the swiper bundle file to match master

* update default slot doc wording

* revert changes

* Revert "update default slot doc wording"

This reverts commit e18401491ede10bb1ee095601d1a0c703721df62.

merge

* docs(slots): update default slot doc wording
2019-02-12 15:51:01 -05:00
7832be3f1c chore(): update stencil (#17163)
* chore(): update stencil

* update
2019-01-19 11:31:15 +01:00
6364e4e2a1 fix(inputs): keyboard focus improvements (#16838)
fixes #16815
fixes #16872
fixes #13978
fixes #16610
2019-01-11 19:36:02 +01:00
f393a82ed6 fix(all): ts 3.2 issues 2018-12-16 18:22:33 +01:00
2933f61e8d fix(react): add class based APIs (#16665)
fixes #16583
2018-12-11 01:08:00 +01:00
d09e55500c chore(): update stencil (#16460) 2018-11-26 22:19:48 +01:00
2884076834 feat(ripple): adds unbounded ripple-effect (#16399) 2018-11-20 23:37:54 +01:00