-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
120 changed files
with
2,790 additions
and
843 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
packages/dnb-design-system-portal/src/docs/uilib/components/copy-on-click.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 @@ | ||
--- | ||
title: 'CopyOnClick' | ||
description: 'The CopyOnClick component allows users to copy text to their clipboard simply by clicking on it.' | ||
showTabs: true | ||
hideTabs: | ||
- title: Events | ||
theme: 'sbanken' | ||
status: 'new' | ||
--- | ||
|
||
import CopyOnClickInfo from 'Docs/uilib/components/copy-on-click/info' | ||
import CopyOnClickDemos from 'Docs/uilib/components/copy-on-click/demos' | ||
|
||
<CopyOnClickInfo /> | ||
<CopyOnClickDemos /> |
38 changes: 38 additions & 0 deletions
38
packages/dnb-design-system-portal/src/docs/uilib/components/copy-on-click/Examples.tsx
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,38 @@ | ||
/** | ||
* UI lib Component Example | ||
* | ||
*/ | ||
|
||
import React from 'react' | ||
import ComponentBox from '../../../../shared/tags/ComponentBox' | ||
import { CopyOnClick, P } from '@dnb/eufemia/src' | ||
|
||
export const Default = () => { | ||
return ( | ||
<ComponentBox> | ||
<P> | ||
<CopyOnClick data-visual-test="copy-on-click-default"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi | ||
cursus pharetra elit in bibendum. Praesent nunc ipsum, convallis | ||
eget convallis gravida, vehicula vitae metus. | ||
</CopyOnClick> | ||
</P> | ||
</ComponentBox> | ||
) | ||
} | ||
|
||
export const CopyCursorHidden = () => { | ||
return ( | ||
<ComponentBox> | ||
<P> | ||
<CopyOnClick | ||
data-visual-test="copy-on-click-cursor-disabled" | ||
showCursor={false} | ||
> | ||
Praesent nunc ipsum, convallis eget convallis gravida, vehicula | ||
vitae metus. | ||
</CopyOnClick> | ||
</P> | ||
</ComponentBox> | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
...ages/dnb-design-system-portal/src/docs/uilib/components/copy-on-click/demos.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 @@ | ||
--- | ||
showTabs: true | ||
--- | ||
|
||
import * as Examples from './Examples' | ||
|
||
## Demo | ||
|
||
### Default | ||
|
||
<Examples.Default /> | ||
|
||
### CopyOnClick cursor hidden | ||
|
||
<Examples.CopyCursorHidden /> |
22 changes: 22 additions & 0 deletions
22
packages/dnb-design-system-portal/src/docs/uilib/components/copy-on-click/info.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,22 @@ | ||
--- | ||
showTabs: true | ||
--- | ||
|
||
## Description | ||
|
||
The `CopyOnClick` component provides a convenient way to copy text to the clipboard with a single click. This component is particularly useful in scenarios where users need to quickly copy text, such as when copying codes, IDs, URLs, or any other text content that needs to be easily shared or reused. | ||
Upon hovering, the component can optionally provide visual feedback to the user, displaying a copy cursor or other visual cues that indicate the component's functionality. | ||
Upon clicking, the component provides a visual feedback to the user, displaying a tooltip with a confirmation message, indicating that the text has been successfully copied. | ||
|
||
### Example | ||
|
||
Here’s a simple usage example of the `CopyOnClick` component: | ||
|
||
```jsx | ||
import { CopyOnClick, P } from '@dnb/eufemia' | ||
render( | ||
<P> | ||
<CopyOnClick>This is the text to copy!</CopyOnClick> | ||
</P>, | ||
) | ||
``` |
10 changes: 10 additions & 0 deletions
10
...dnb-design-system-portal/src/docs/uilib/components/copy-on-click/properties.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,10 @@ | ||
--- | ||
showTabs: true | ||
--- | ||
|
||
import PropertiesTable from 'dnb-design-system-portal/src/shared/parts/PropertiesTable' | ||
import { CopyOnClickProperties } from '@dnb/eufemia/src/components/copy-on-click/CopyOnClickDocs' | ||
|
||
## Properties | ||
|
||
<PropertiesTable props={CopyOnClickProperties} /> |
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
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
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
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.