Skip to content

Commit 5068250

Browse files
committed
rename uui-form-item to uui-form-layout-item
1 parent 28e3600 commit 5068250

File tree

11 files changed

+87
-46
lines changed

11 files changed

+87
-46
lines changed

package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/uui-form-item/README.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/uui-form-item/lib/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# uui-form-layout-item
2+
3+
![npm](https://img.shields.io/npm/v/@umbraco-ui/uui-form-layout-item?logoColor=%231B264F)
4+
5+
Umbraco style uui-form-layout-item component.
6+
7+
## Installation
8+
9+
### ES imports
10+
11+
```zsh
12+
npm i @umbraco-ui/uui-form-layout-item
13+
```
14+
15+
Import the registration of `<uui-form-layout-item>` via:
16+
17+
```javascript
18+
import '@umbraco-ui/uui-form-layout-item/';
19+
```
20+
21+
When looking to leverage the `UUIFormLayoutItemElement` base class as a type and/or for extension purposes, do so via:
22+
23+
```javascript
24+
import { UUIFormLayoutItemElement } from '@umbraco-ui/uui-form-layout-item';
25+
```
26+
27+
## Usage
28+
29+
```html
30+
<uui-form-layout-item></uui-form-layout-item>
31+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './uui-form-layout-item.element';

packages/uui-form-item/lib/uui-form-item.element.ts renamed to packages/uui-form-layout-item/lib/uui-form-layout-item.element.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
55
// TODO: Make sure validation messages can be seen for the whole Form Item. Make them follow the screen if form controls are taller than available screen height.
66

77
/**
8-
* @element uui-form-item
8+
* @element uui-form-layout-item
99
* @description - Form item composes label, input and validation-messages in a proper layout.
1010
* @slot - for button contents
1111
* @slot message - for extras in the messages container
1212
*/
1313

14-
@defineElement('uui-form-item')
15-
export class UUIFormItemElement extends LitElement {
14+
@defineElement('uui-form-layout-item')
15+
export class UUIFormLayoutItemElement extends LitElement {
1616
static styles = [
1717
css`
1818
:host {
@@ -84,6 +84,6 @@ export class UUIFormItemElement extends LitElement {
8484

8585
declare global {
8686
interface HTMLElementTagNameMap {
87-
'uui-form-item': UUIFormItemElement;
87+
'uui-form-layout-item': UUIFormLayoutItemElement;
8888
}
8989
}

packages/uui-form-item/lib/uui-form-item.test.ts renamed to packages/uui-form-layout-item/lib/uui-form-layout-item.test.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import { html, fixture, expect } from '@open-wc/testing';
2-
import { UUIFormItemElement } from './uui-form-item.element';
2+
import { UUIFormLayoutItemElement } from './uui-form-layout-item.element';
33
import '.';
44

5-
describe('UUIFormItemElement', () => {
6-
let element: UUIFormItemElement;
5+
describe('UUIFormLayoutItemElement', () => {
6+
let element: UUIFormLayoutItemElement;
77

88
beforeEach(async () => {
9-
element = await fixture(html` <uui-form-item></uui-form-item> `);
9+
element = await fixture(
10+
html` <uui-form-layout-item></uui-form-layout-item> `
11+
);
1012
});
1113

1214
it('is defined', () => {
13-
expect(element).to.be.instanceOf(UUIFormItemElement);
15+
expect(element).to.be.instanceOf(UUIFormLayoutItemElement);
1416
});
1517

1618
it('passes the a11y audit', async () => {
@@ -29,6 +31,11 @@ describe('UUIFormItemElement', () => {
2931
expect(slot).to.exist;
3032
});
3133

34+
it('renders an label slot', () => {
35+
const slot = element.shadowRoot!.querySelector('slot[name=label]')!;
36+
expect(slot).to.exist;
37+
});
38+
3239
it('renders an message slot', () => {
3340
const slot = element.shadowRoot!.querySelector('slot[name=message]')!;
3441
expect(slot).to.exist;

packages/uui-form-item/package.json renamed to packages/uui-form-layout-item/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@umbraco-ui/uui-form-item",
2+
"name": "@umbraco-ui/uui-form-layout-item",
33
"version": "0.0.0",
44
"license": "MIT",
55
"keywords": [
@@ -10,16 +10,16 @@
1010
"Lit",
1111
"Form Item"
1212
],
13-
"description": "Umbraco UI form-item component",
13+
"description": "Umbraco UI form-layout-item component",
1414
"repository": {
1515
"type": "git",
1616
"url": "https://github.com/umbraco/Umbraco.UI.git",
17-
"directory": "packages/uui-form-item"
17+
"directory": "packages/uui-form-layout-item"
1818
},
1919
"bugs": {
2020
"url": "https://github.com/umbraco/Umbraco.UI/issues"
2121
},
22-
"main": "./dist/uui-form-item.min.js",
22+
"main": "./dist/uui-form-layout-item.min.js",
2323
"module": "./lib/index.js",
2424
"customElements": "custom-elements.json",
2525
"files": [
@@ -38,5 +38,5 @@
3838
"publishConfig": {
3939
"access": "public"
4040
},
41-
"homepage": "https://uui.umbraco.com/?path=/story/uui-form-item"
41+
"homepage": "https://uui.umbraco.com/?path=/story/uui-form-layout-item"
4242
}

0 commit comments

Comments
 (0)