Skip to content

Commit 4f7f732

Browse files
jawinnaramos-adobe
authored andcommitted
feat(picker)!: migrate to spectrum 2 (#2697)
Migrates the Picker component to Spectrum 2, based on the updated Figma specs. - Integrate themes CSS files into index.css - Uses new S2 tokens for field width and corner rounding - Add down state with new calculated perspective - The top to alert icon in Spectrum 2 now uses the component-top-to-workflow-icon-* tokens as defined on the design. - Adds the CJK line-height token defined on the design specs. - Uses border-width-200 instead of border-width-100 * fix(picker): use correct spacing between icons and value text The spacing between alert icon and disclosure icon was incorrect because it was being overridden by a selector that shouldn't have been affecting this scenario (which was using the subsequent-sibling combinator ~). Some mods around the spacing for the three different types of icons were also not working as expected. Fixes this spacing and clarifies which spacing is which. Renames the mod that applies to the optional workflow icon to the left of the value. Simplifies quiet styles by changing custom property values instead of adding extra styles. * feat(picker): storybook - expanded and improved chromatic template Expands the Chromatic-only template in Storybook to increase coverage of different options. Organizes the stories into sections using the formatting and typography previously established with Action button. States in each section are based on the grid of options in the Desktop S2 design Figma, with some additions such as the loading state. And the Switch examples from the existing template. Removes the "Open" story which is now covered in the Chromatic template. Adds missing icon (to left of value/placeholder text) option to Storybook, along with VRT coverage. Improves display of Popover within these different contexts; fixes how it is aligned on the side label example. Changes the side label example to use flex row instead of using inline-block which could wrap as the screen shrunk. === Other Storybook fixes and additions === - Adds aria-labelledby and unique ids to make sure the label is associated with the Picker. - Includes downstate dimension capture - Popover does not show when in the loading state (per design feedback) - Makes sure HelpText appears below the Picker when using side label, by adjusting its wrapper markup. - Adds conditional controls to disabled and loading states, per the PR feedback that disabled + loading should not be a possible combo.
1 parent df44a47 commit 4f7f732

File tree

5 files changed

+579
-0
lines changed

5 files changed

+579
-0
lines changed

components/picker/index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*!
2+
<<<<<<< HEAD
23
* Copyright 2024 Adobe. All rights reserved.
34
*
45
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -10,6 +11,19 @@
1011
* OF ANY KIND, either express or implied. See the License for the specific language
1112
* governing permissions and limitations under the License.
1213
*/
14+
=======
15+
Copyright 2024 Adobe. All rights reserved.
16+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
17+
you may not use this file except in compliance with the License. You may obtain a copy
18+
of the License at http://www.apache.org/licenses/LICENSE-2.0
19+
20+
Unless required by applicable law or agreed to in writing, software distributed under
21+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22+
OF ANY KIND, either express or implied. See the License for the specific language
23+
governing permissions and limitations under the License.
24+
*/
25+
26+
>>>>>>> 5d730fe71 (feat(picker)!: migrate to spectrum 2 (#2697))
1327
@import "@spectrum-css/commons/basebutton.css";
1428

1529
.spectrum-Picker {

components/picker/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@
4848
}
4949
},
5050
"devDependencies": {
51+
<<<<<<< HEAD
5152
"@spectrum-css/commons": "workspace:^",
5253
"@spectrum-css/helptext": "workspace:^",
5354
"@spectrum-css/icon": "workspace:^",
5455
"@spectrum-css/menu": "workspace:^",
5556
"@spectrum-css/popover": "workspace:^",
5657
"@spectrum-css/progresscircle": "workspace:^",
5758
"@spectrum-css/tokens": "workspace:^"
59+
=======
60+
"@spectrum-css/commons": "^9.1.4-next.1"
61+
>>>>>>> 5d730fe71 (feat(picker)!: migrate to spectrum 2 (#2697))
5862
},
5963
"keywords": [
6064
"spectrum",

0 commit comments

Comments
 (0)