-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,31 @@ | ||
# uui-copy | ||
|
||
![npm](https://img.shields.io/npm/v/@umbraco-ui/uui-copy?logoColor=%231B264F) | ||
|
||
Umbraco style copy component. | ||
|
||
## Installation | ||
|
||
### ES imports | ||
|
||
```zsh | ||
npm i @umbraco-ui/uui-copy | ||
``` | ||
|
||
Import the registration of `<uui-copy>` via: | ||
|
||
```javascript | ||
import '@umbraco-ui/uui-copy'; | ||
``` | ||
|
||
When looking to leverage the `UUICopyElement` base class as a type and/or for extension purposes, do so via: | ||
|
||
```javascript | ||
import { UUICopyElement } from '@umbraco-ui/uui-copy'; | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<uui-copy></uui-copy> | ||
``` |
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 @@ | ||
export * from './uui-copy.element'; |
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,28 @@ | ||
import { defineElement } from '@umbraco-ui/uui-base/lib/registration'; | ||
import { css, html, LitElement } from 'lit'; | ||
|
||
/** | ||
* @element uui-copy | ||
*/ | ||
@defineElement('uui-copy') | ||
export class UUICopyElement extends LitElement { | ||
static styles = [ | ||
css` | ||
:host { | ||
/* Styles goes here */ | ||
} | ||
`, | ||
]; | ||
|
||
render(){ | ||
return html` | ||
Markup goes here | ||
`; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'uui-copy': UUICopyElement; | ||
} | ||
} |
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,24 @@ | ||
import type { Meta, StoryObj } from '@storybook/web-components'; | ||
|
||
import './uui-copy.element'; | ||
import type { UUICopyElement } from './uui-copy.element'; | ||
import readme from '../README.md?raw'; | ||
|
||
const meta: Meta<UUICopyElement> = { | ||
id: 'uui-copy', | ||
title: 'Copy', | ||
component: 'uui-copy', | ||
parameters: { | ||
readme: { markdown: readme }, | ||
docs: { | ||
source: { | ||
code: `<uui-copy></uui-copy>`, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<UUICopyElement>; | ||
|
||
export const Overview: Story = {}; |
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,20 @@ | ||
import { html, fixture, expect } from '@open-wc/testing'; | ||
import { UUICopyElement } from './uui-copy.element'; | ||
|
||
describe('UUICopyElement', () => { | ||
let element: UUICopyElement; | ||
|
||
beforeEach(async () => { | ||
element = await fixture( | ||
html` <uui-copy></uui-copy> ` | ||
); | ||
}); | ||
|
||
it('is defined with its own instance', () => { | ||
expect(element).to.be.instanceOf(UUICopyElement); | ||
}); | ||
|
||
it('passes the a11y audit', async () => { | ||
await expect(element).shadowDom.to.be.accessible(); | ||
}); | ||
}); |
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,44 @@ | ||
{ | ||
"name": "@umbraco-ui/uui-copy", | ||
"version": "0.0.0", | ||
"license": "MIT", | ||
"keywords": [ | ||
"Umbraco", | ||
"Custom elements", | ||
"Web components", | ||
"UI", | ||
"Lit", | ||
"Copy" | ||
], | ||
"description": "Umbraco UI copy component", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/umbraco/Umbraco.UI.git", | ||
"directory": "packages/uui-copy" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/umbraco/Umbraco.UI/issues" | ||
}, | ||
"main": "./lib/index.js", | ||
"module": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"type": "module", | ||
"customElements": "custom-elements.json", | ||
"files": [ | ||
"lib/**/*.d.ts", | ||
"lib/**/*.js", | ||
"custom-elements.json" | ||
], | ||
"dependencies": { | ||
"@umbraco-ui/uui-base": "1.12.2" | ||
}, | ||
"scripts": { | ||
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js", | ||
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js *.tgz lib/**/*.d.ts custom-elements.json", | ||
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"homepage": "https://uui.umbraco.com/?path=/story/uui-copy" | ||
} |
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,5 @@ | ||
import { UUIProdConfig } from '../rollup-package.config.mjs'; | ||
|
||
export default UUIProdConfig({ | ||
entryPoints: ['index'] | ||
}); |
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,17 @@ | ||
// Don't edit this file directly. It is generated by /scripts/generate-ts-config.js | ||
|
||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"rootDir": "./lib", | ||
"composite": true | ||
}, | ||
"include": ["./**/*.ts"], | ||
"exclude": ["./**/*.test.ts", "./**/*.story.ts"], | ||
"references": [ | ||
{ | ||
"path": "../uui-base" | ||
} | ||
] | ||
} |
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