-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(arch): move && simplify component link
- Loading branch information
Showing
87 changed files
with
481 additions
and
513 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 80 additions & 0 deletions
80
packages-new/components/link/documentation/specifications/spec.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
* [**Interfaces**](#interfaces) | ||
* [**Types**](#types) | ||
* [**Classes**](#classes) | ||
* [**Type alias**](#type-alias) | ||
* [**Variables**](#variables) | ||
|
||
## Interfaces | ||
|
||
### OdsLinkAttributes | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`color`** | `OdsThemeColorIntent` | | | Link color theme| | ||
|**`contrasted`** | _boolean_ | | | Link design as contrasted version| | ||
|**`disabled`** | _boolean_ | | | Link should be disabled or not| | ||
|**`download`** | _string_ | | | Link as download source| | ||
|**`href`** | _string_ | | | Link URL| | ||
|**`referrerpolicy`** | `OdsLinkReferrerpolicy` | | | Link referrer policy| | ||
|**`rel`** | `OdsHTMLAnchorElementRel` | | | Link relationship| | ||
|**`target`** | `OdsHTMLAnchorElementTarget` | | | Link target typeIf href is set the default value `_self` is set| | ||
|**`type`** | _string_ | | | Link type (for download source)| | ||
|
||
### OdsLinkBehavior | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`beforeRender`** | _void_ | ✴️ | | before render component functionshould be called before component renderit have to check the validity of attributes.| | ||
|
||
## Types | ||
|
||
### OdsLinkReferrerpolicy | ||
| | | ||
|:---:| | ||
| `no-referrer` | | ||
| `no-referrer-when-downgrade` | | ||
| `origin` | | ||
| `origin-when-cross-origin` | | ||
| `same-origin` | | ||
| `strict-origin-when-cross-origin` | | ||
| `unsafe-url` | | ||
|
||
## Classes | ||
|
||
### OdsLinkController | ||
_common controller logic for link component used by the different implementations._ | ||
_it contains all the glue between framework implementation and the third party service._ | ||
|
||
#### Methods | ||
> **validateAttributes**() => _unknown_ | ||
|
||
|
||
### OdsLinkMock | ||
|
||
## Type alias | ||
|
||
### OdsLink | ||
|
||
interface description of all implementation of `ods-link`. | ||
each implementation must have defined events, methods, attributes | ||
and one controller for the common behavior logic | ||
|
||
> - `OdsComponentGenericMethods` | ||
> - `OdsComponentGenericEvents` | ||
### OdsLinkAttributes | ||
|
||
> _Based on `OdsComponentAttributes`_ | ||
### OdsLinkEvents | ||
|
||
> _Based on `OdsComponentEvents`_ | ||
### OdsLinkMethods | ||
|
||
> _Based on `OdsComponentMethods`_ | ||
## Variables | ||
|
||
### odsLinkDefaultAttributes | ||
`OdsLinkAttributes` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
packages-new/components/link/documentation/specifications/specifications-link.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {Description} from '@storybook/addon-docs'; | ||
import Specs from './spec.md'; | ||
import SpecsLinkContents from './specifications-link-contents.mdx'; | ||
import SpecsLinkTests from './specifications-link-tests.mdx'; | ||
|
||
## Description | ||
The link component has many combinations of features. | ||
|
||
<Description>{Specs}</Description> | ||
|
||
## Contents | ||
<SpecsLinkContents /> | ||
|
||
## Tests | ||
<SpecsLinkTests /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages-new/components/link/src/components/osds-link/constants/referrer-policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
enum ODS_LINK_REFERRER_POLICY { | ||
noReferrer = 'no-referrer', | ||
noReferrerWhenDowngrade = 'no-referrer-when-downgrade', | ||
origin = 'origin', | ||
originWhenCrossOrigin = 'origin-when-cross-origin', | ||
sameOrigin = 'same-origin', | ||
strictOriginWhenCrossOrigin = 'strict-origin-when-cross-origin', | ||
unsafeUrl = 'unsafe-url', | ||
} | ||
|
||
const ODS_LINK_REFERRER_POLICIES = Object.freeze(Object.values(ODS_LINK_REFERRER_POLICY)); | ||
|
||
export { | ||
ODS_LINK_REFERRER_POLICIES, | ||
ODS_LINK_REFERRER_POLICY, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.