-
Notifications
You must be signed in to change notification settings - Fork 239
chore: clean up patterns #5935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: clean up patterns #5935
Conversation
|
2nd-gen/packages/swc/components/divider/stories/divider.stories.ts
Outdated
Show resolved
Hide resolved
2nd-gen/packages/swc/components/divider/stories/divider.stories.ts
Outdated
Show resolved
Hide resolved
2nd-gen/packages/swc/components/progress-circle/stories/progress-circle.stories.ts
Outdated
Show resolved
Hide resolved
2nd-gen/packages/swc/components/progress-circle/stories/progress-circle.stories.ts
Outdated
Show resolved
Hide resolved
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
| </sp-table-row> | ||
| </sp-table-body> | ||
| </sp-table> | ||
| | Area | 1st-gen SWC | 2nd-gen SWC | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s1 styles/variables arent loaded in 2nd gen so it was rendering odd, i switched to markdown table which has some nice borders and subtle color diff between rows. (we absolutely can revisit using our components in docs)
|
|
||
| ### You want built-in accessibility | ||
| <sp-accordion allow-multiple size="m" class="docs-accordion"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i override the border color with this class so match the hr under the h2. same issue with s1 variables not mapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i modified this decorator to have some set flex styles to unlock its scalability. we can continue to add layout styles to this new pattern as we come across odd layouts
| Providing the correct issue severity classification helps us adequately assess and prioritize your issue. We reserve the right to adjust the severity of your bug during triage. | ||
| Below is our issue severity classification criteria: | ||
|
|
||
| <sp-table size="m"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about the table as above
|
|
||
| Create `stories/[component].usage.mdx` to display stories organized by section. | ||
|
|
||
| ```mdx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this section is dynamically generated with the GettingStarted doc block
| subtitle: `Assets visually represent a file, folder or image in your application.`, | ||
| subtitle: `Visually represent files, folders, or images in your application`, | ||
| }, | ||
| flexLayout: 'row-nowrap', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now we can set the most common flex layout in the meta and then overwrite it at the storylevel if you need. i found most stories lean in to row-wrap or column-stretch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOVE THIS!!!!
|
|
||
| type StatusLightVariant = typeof StatusLight.prototype.variant; | ||
| type StatusLightSize = typeof StatusLight.prototype.size; | ||
| const semanticLabels = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the pattern for custom labeling when using type consts to generate templates in a story
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
| type: 'dynamic', | ||
| type: 'auto', | ||
| language: 'html', | ||
| transform: async (source: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SOURCE BLOCK LINTING....... SOOOOOO GOOOOODDDD
…b-components into caseyisonit/addon-party
| subtitle: `Assets visually represent a file, folder or image in your application.`, | ||
| subtitle: `Visually represent files, folders, or images in your application`, | ||
| }, | ||
| flexLayout: 'row-nowrap', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOVE THIS!!!!
| * ### Visual structure | ||
| * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * ### Visual structure | |
| * |
| * An asset consists of: | ||
| * | ||
| * 1. **Icon or image content** - Either a file/folder icon or custom slotted content | ||
| * 2. **Accessible label** - Provides context for assistive technologies | ||
| * | ||
| * The asset automatically centers its content both horizontally and vertically within the available space. | ||
| * | ||
| * ### Technical structure | ||
| * | ||
| * #### Slots | ||
| * | ||
| * - **Default slot**: Custom content to display (typically an image) when variant is not set | ||
| * | ||
| * #### Properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * An asset consists of: | |
| * | |
| * 1. **Icon or image content** - Either a file/folder icon or custom slotted content | |
| * 2. **Accessible label** - Provides context for assistive technologies | |
| * | |
| * The asset automatically centers its content both horizontally and vertically within the available space. | |
| * | |
| * ### Technical structure | |
| * | |
| * #### Slots | |
| * | |
| * - **Default slot**: Custom content to display (typically an image) when variant is not set | |
| * | |
| * #### Properties | |
| * An asset consists of: | |
| * | |
| * 1. **Icon or image content** - Either a file/folder icon or custom slotted content | |
| * 2. **Accessible label** - Provides context for assistive technologies |
| * Properties that control the asset's appearance: | ||
| * | ||
| * - [**Variant**](#variants): Controls which built-in icon to display (`file`, `folder`, or unset for custom content) | ||
| * - **Label**: Accessible label for screen readers (used as `aria-label` on the icon SVGs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Properties that control the asset's appearance: | |
| * | |
| * - [**Variant**](#variants): Controls which built-in icon to display (`file`, `folder`, or unset for custom content) | |
| * - **Label**: Accessible label for screen readers (used as `aria-label` on the icon SVGs) |
| * A progress circle consists of: | ||
| * | ||
| * 1. **Track** - Background ring showing the full progress range | ||
| * 2. **Fill** - Colored ring segment showing current progress | ||
| * 3. **Label** - Accessible text describing the operation (not visually rendered) | ||
| * | ||
| * ### Technical structure | ||
| * | ||
| * #### Slots | ||
| * | ||
| * - **Default slot**: Alternative way to provide an accessible label (the `label` attribute is preferred) | ||
| * | ||
| * #### Properties | ||
| * | ||
| * - [**Progress**](#progress-values): Numeric value from 0-100 controlling the fill amount | ||
| * - [**Label**](#progress-values): Accessible text describing what is loading or progressing | ||
| * - [**Indeterminate**](#indeterminate): Boolean controlling animated vs. determinate state | ||
| * - [**Size**](#sizes): Visual size (s, m, or l) | ||
| * - [**Static color**](#static-colors): Color variant for use on different backgrounds (white or black) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * A progress circle consists of: | |
| * | |
| * 1. **Track** - Background ring showing the full progress range | |
| * 2. **Fill** - Colored ring segment showing current progress | |
| * 3. **Label** - Accessible text describing the operation (not visually rendered) | |
| * | |
| * ### Technical structure | |
| * | |
| * #### Slots | |
| * | |
| * - **Default slot**: Alternative way to provide an accessible label (the `label` attribute is preferred) | |
| * | |
| * #### Properties | |
| * | |
| * - [**Progress**](#progress-values): Numeric value from 0-100 controlling the fill amount | |
| * - [**Label**](#progress-values): Accessible text describing what is loading or progressing | |
| * - [**Indeterminate**](#indeterminate): Boolean controlling animated vs. determinate state | |
| * - [**Size**](#sizes): Visual size (s, m, or l) | |
| * - [**Static color**](#static-colors): Color variant for use on different backgrounds (white or black) | |
| * A progress circle consists of: | |
| * | |
| * 1. **Track** - Background ring showing the full progress range | |
| * 2. **Fill** - Colored ring segment showing current progress, via `progress` attribute | |
| * 3. **Label** - Accessible text, via `label` attribute, describing the operation (not visually rendered) |
| ${template({ | ||
| ...args, | ||
| progress: 0, | ||
| size: 'l', | ||
| label: 'Starting upload', | ||
| })} | ||
| ${template({ | ||
| ...args, | ||
| progress: 50, | ||
| size: 'l', | ||
| label: 'Uploading document', | ||
| })} | ||
| ${template({ | ||
| ...args, | ||
| progress: 100, | ||
| size: 'l', | ||
| label: 'Upload complete', | ||
| })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this example!
|
|
||
| type StatusLightVariant = typeof StatusLight.prototype.variant; | ||
| type StatusLightSize = typeof StatusLight.prototype.size; | ||
| const semanticLabels = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
| * ### Visual structure | ||
| * | ||
| * A status light consists of: | ||
| * | ||
| * 1. **Colored dot indicator** - Visual representation of status or category | ||
| * 2. **Text label** - Descriptive text providing context | ||
| * | ||
| * ### Technical structure | ||
| * | ||
| * #### Slots | ||
| * | ||
| * - **Default slot**: Text label describing the status (required) | ||
| * | ||
| * #### Properties | ||
| * | ||
| * Properties that control visual appearance: | ||
| * | ||
| * - **Variant**: Controls the color of the status dot ([semantic](#semantic-variants) or [non-semantic](#non-semantic-variants) variants) | ||
| * - [**Size**](#sizes): Controls the overall size of the component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * ### Visual structure | |
| * | |
| * A status light consists of: | |
| * | |
| * 1. **Colored dot indicator** - Visual representation of status or category | |
| * 2. **Text label** - Descriptive text providing context | |
| * | |
| * ### Technical structure | |
| * | |
| * #### Slots | |
| * | |
| * - **Default slot**: Text label describing the status (required) | |
| * | |
| * #### Properties | |
| * | |
| * Properties that control visual appearance: | |
| * | |
| * - **Variant**: Controls the color of the status dot ([semantic](#semantic-variants) or [non-semantic](#non-semantic-variants) variants) | |
| * - [**Size**](#sizes): Controls the overall size of the component | |
| * A status light consists of: | |
| * | |
| * 1. **Colored dot indicator** - Visual representation of status or category | |
| * 2. **Text label** - Descriptive text providing context, via the default slot (required) |
| * - **Small (`s`)**: Used for inline indicators or space-constrained areas | ||
| * - **Medium (`m`)**: Default size, used for typical use cases | ||
| * - **Large (`l`)**: Used for prominent displays or primary content areas | ||
| * - **Extra-large (`xl`)**: Maximum visibility for high-priority statuses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOVE THIS!
Co-authored-by: Nikki Massaro <[email protected]>
Description
Motivation and context
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Descriptive Test Statement
Descriptive Test Statement
Device review