Skip to content

Commit

Permalink
docs(sbb-button, sbb-link): fix is-static flag control (#2372)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB authored Jan 29, 2024
1 parent 85b5640 commit b1683e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/button/button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const defaultArgTypes: ArgTypes = {
variant,
negative,
size,
static: isStatic,
'is-static': isStatic,
'icon-name': iconName,
href,
target,
Expand All @@ -259,7 +259,7 @@ const defaultArgs: Args = {
variant: variant.options[0],
negative: false,
size: size.options[0],
static: false,
'is-static': false,
'icon-name': 'arrow-right-small',
href: undefined,
target: undefined,
Expand Down
1 change: 1 addition & 0 deletions src/components/button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ depending on the value of the `href` property, so the associated properties are
(`href`, `target`, `rel` and `download` for link; `type`, `name`, `value` and `form` for button).

If `isStatic` is set, the component will be rendered as a button without any user interaction.
The `isStatic` is only considered during initial rendering (connectedCallback), later configuration changes are ignored.
Please note that if the `sbb-button` is placed inside another anchor or button tag,
it is internally rendered as a span in order to not break HTML functionality.
If the component is placed inside an `sbb-form-field`, it renders with the correct styling.
Expand Down
4 changes: 2 additions & 2 deletions src/components/link/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const defaultArgTypes: ArgTypes = {
variant,
negative,
size,
static: isStatic,
'is-static': isStatic,
'icon-name': iconName,
'icon-placement': iconPlacement,
href,
Expand All @@ -219,7 +219,7 @@ const defaultArgs: Args = {
variant: variant.options[0],
negative: false,
size: size.options[1],
static: false,
'is-static': false,
'icon-name': undefined,
'icon-placement': iconPlacement.options[0],
href: href.options[1],
Expand Down
1 change: 1 addition & 0 deletions src/components/link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The component can be internally rendered as a button or as a link,
depending on the value of the `href` property, so the associated properties are available
(`href`, `target`, `rel` and `download` for link; `type`, `name`, `value` and `form` for button).
If `isStatic` is set, the component will be rendered as a link without any user interaction.
The `isStatic` is only considered during initial rendering (connectedCallback), later configuration changes are ignored.
Please note that if the `sbb-link` is placed inside another anchor or button tag,
it is internally rendered as a span in order to not break HTML functionality.

Expand Down

0 comments on commit b1683e3

Please sign in to comment.