@iyulab/components 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +1 -1
- package/dist/components/alert/UAlert.d.ts +8 -0
- package/dist/components/alert/UAlert.js +16 -7
- package/dist/components/alert/UAlert.styles.js +21 -1
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +5 -1
- package/dist/components/card/UCard.d.ts +15 -2
- package/dist/components/card/UCard.js +23 -2
- package/dist/components/card/UCard.styles.js +18 -0
- package/dist/components/expander/UExpander.styles.js +3 -1
- package/dist/components/field/UField.d.ts +4 -0
- package/dist/components/field/UField.js +4 -4
- package/dist/components/menu-item/UMenuItem.styles.js +4 -1
- package/dist/components/tab/UTab.d.ts +24 -4
- package/dist/components/tab/UTab.js +51 -8
- package/dist/components/tab/UTab.styles.js +33 -1
- package/dist/components/tab-nav/UTabNav.d.ts +34 -0
- package/dist/components/tab-nav/UTabNav.js +44 -0
- package/dist/components/tab-nav/UTabNav.styles.d.ts +1 -0
- package/dist/components/tab-nav/UTabNav.styles.js +38 -0
- package/dist/components/tag/UTag.d.ts +4 -0
- package/dist/components/tag/UTag.js +5 -0
- package/dist/components/tag/UTag.styles.js +12 -0
- package/dist/components/tree-item/UTreeItem.styles.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/react/UTabNav.d.ts +14 -0
- package/dist/react/UTabNav.js +10 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +2 -1
- package/skills/iyulab-components/references/components/alert.md +18 -0
- package/skills/iyulab-components/references/components/card.md +16 -1
- package/skills/iyulab-components/references/components/field.md +4 -0
- package/skills/iyulab-components/references/components/tab-nav.md +63 -0
- package/skills/iyulab-components/references/components/tab-panel.md +15 -1
- package/skills/iyulab-components/references/components/tag.md +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.26.0] - 2026-10-14
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `u-field` parts `header`, `label`, `required` and `footer` — a theme can draw the label row and the line under the
|
|
8
|
+
control (description, or the validation message while `invalid`) its own way. Before, only the hint icon and its
|
|
9
|
+
tooltip were reachable.
|
|
10
|
+
|
|
11
|
+
## [2.25.0] - 2026-10-14
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **`u-alert inline` — an alert in the page flow.** Without it an alert has the floating look a toast uses: content
|
|
16
|
+
width, a large shadow, a scale transition, and the space it keeps while closed. With `inline` it fills its
|
|
17
|
+
container, drops the shadow and the transition, and takes no space while closed — for a callout, an error summary
|
|
18
|
+
or a result line. The default look is unchanged.
|
|
19
|
+
- `u-alert` `icon` slot — replaces the status icon (a pencil on a note).
|
|
20
|
+
- **`u-card href` — a card that is a link.** The outer box renders as an `<a>` (with `target`, `rel`, `download`): the
|
|
21
|
+
text stays ink with no underline, the border carries hover, and the card does not lift. The focus ring is drawn
|
|
22
|
+
inside the box, since the card clips its overflow. A host `aria-label` names the link.
|
|
23
|
+
- **`u-tag size="sm"` — a mark inside a line of text.** The overline text size and its leading with no block
|
|
24
|
+
padding: about 18px with the border, so an attribute next to an id does not grow a dense table row. The default
|
|
25
|
+
(`md`) is unchanged.
|
|
26
|
+
- **`u-tab-nav` — a tab strip of links.** For tabs that are URLs (saved views): a `<nav>` landmark named by `label`
|
|
27
|
+
whose tabs are links (`<u-tab href>`), with the current one marked by `value` (or `active`) and announced as
|
|
28
|
+
`aria-current="page"`. Each link is a Tab stop; there is no tab role and no arrow-key model — those belong to
|
|
29
|
+
`u-tab-panel`, which switches panels on one page.
|
|
30
|
+
- `u-tab` `href` / `target` / `rel` — the tab renders as a link for `u-tab-nav` (no tab role, no remove button).
|
|
31
|
+
- `u-tab` `count` — a quiet count after the label (smaller, weaker, tabular digits in the active locale), in a panel
|
|
32
|
+
tab or a link tab.
|
|
33
|
+
- `u-tab` `active` is now a declared property. The tab panel already set the attribute; a link tab reads it.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- `u-alert` keeps a `role` the author set. It wrote its derived role (`alert` / `status`) on every update, so a
|
|
38
|
+
static note could not be `role="note"` and was announced as a live region. The derived role still applies when
|
|
39
|
+
the author leaves `role` empty.
|
|
40
|
+
|
|
3
41
|
## [2.24.0] - 2026-10-14
|
|
4
42
|
|
|
5
43
|
### Added
|
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ npx skills add ./node_modules/@iyulab/components
|
|
|
130
130
|
|
|
131
131
|
**Overlay & Floating** — `u-dialog`, `u-drawer`, `u-popover`, `u-tooltip`
|
|
132
132
|
|
|
133
|
-
**Navigation** — `u-menu`, `u-menu-item`, `u-tab-panel`, `u-breadcrumb`, `u-breadcrumb-item`, `u-pagination`, `u-tree`, `u-tree-item`
|
|
133
|
+
**Navigation** — `u-menu`, `u-menu-item`, `u-tab-panel`, `u-tab-nav`, `u-breadcrumb`, `u-breadcrumb-item`, `u-pagination`, `u-tree`, `u-tree-item`
|
|
134
134
|
|
|
135
135
|
**Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-expander`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
|
|
136
136
|
|
|
@@ -16,6 +16,7 @@ export type AlertAppearance = "soft" | "outlined";
|
|
|
16
16
|
*
|
|
17
17
|
* @slot - Alert 본문 콘텐츠
|
|
18
18
|
* @slot footer - Alert 하단 콘텐츠 (예: 액션 버튼)
|
|
19
|
+
* @slot icon - 상태 아이콘을 대신할 아이콘 (예: 메모의 연필). 비우면 `status` 의 아이콘
|
|
19
20
|
*
|
|
20
21
|
* @csspart container - 전체 Alert 컨테이너 (flex column)
|
|
21
22
|
* @csspart header - 아이콘·타이틀·닫기 버튼을 포함하는 상단 행
|
|
@@ -49,6 +50,13 @@ export declare class UAlert extends UElement {
|
|
|
49
50
|
title: string;
|
|
50
51
|
/** 자동 닫힘 타이머 (밀리초 단위, 0이하면 비활성화) */
|
|
51
52
|
duration: number;
|
|
53
|
+
/**
|
|
54
|
+
* 페이지 흐름 안의 알림 — 그 자리의 폭을 채우고, 그림자와 확대 전환이 없고, 닫히면 자리를 비운다.
|
|
55
|
+
* 기본(속성 없음)은 떠 있는 알림(토스트)의 모양이다.
|
|
56
|
+
*/
|
|
57
|
+
inline: boolean;
|
|
58
|
+
/** 역할·`aria-atomic` — 작성자가 단 값(정적 메모의 `role="note"` 등)은 덮지 않는다. */
|
|
59
|
+
private readonly aria;
|
|
52
60
|
/** 자동 닫힘 타이머 ID */
|
|
53
61
|
private timeoutId?;
|
|
54
62
|
protected updated(changedProperties: PropertyValues): void;
|
|
@@ -2,6 +2,7 @@ import { Locale } from "../../utilities/Locale.js";
|
|
|
2
2
|
import { UElement } from "../UElement.js";
|
|
3
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.js";
|
|
4
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.js";
|
|
5
|
+
import { HostAria } from "../../utilities/hostAria.js";
|
|
5
6
|
import "../button/UButton.js";
|
|
6
7
|
import { devWarnOnce } from "../../utilities/devWarning.js";
|
|
7
8
|
import "../icon/UIcon.js";
|
|
@@ -38,6 +39,8 @@ var UAlert = class UAlert extends UElement {
|
|
|
38
39
|
this.appearance = "soft";
|
|
39
40
|
this.title = "";
|
|
40
41
|
this.duration = 0;
|
|
42
|
+
this.inline = false;
|
|
43
|
+
this.aria = new HostAria(this);
|
|
41
44
|
}
|
|
42
45
|
static {
|
|
43
46
|
this.styles = [super.styles, styles];
|
|
@@ -45,19 +48,21 @@ var UAlert = class UAlert extends UElement {
|
|
|
45
48
|
updated(changedProperties) {
|
|
46
49
|
super.updated(changedProperties);
|
|
47
50
|
if (changedProperties.has("open")) this.setTimer(this.open);
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
51
|
+
this.aria.set("role", this.mapRole(this.status));
|
|
52
|
+
this.aria.set("aria-atomic", "true");
|
|
50
53
|
if (changedProperties.has("status")) this.warnUnknownStatus();
|
|
51
54
|
}
|
|
52
55
|
render() {
|
|
53
56
|
return html`
|
|
54
57
|
<div class="container" part="container">
|
|
55
58
|
<div class="header" part="header">
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
<slot name="icon" class="icon-slot">
|
|
60
|
+
<u-icon class="icon" part="icon"
|
|
61
|
+
?hidden=${!this.status}
|
|
62
|
+
lib="internal"
|
|
63
|
+
name=${this.mapIcon(this.status)}
|
|
64
|
+
></u-icon>
|
|
65
|
+
</slot>
|
|
61
66
|
<div class="title" part="title">
|
|
62
67
|
${this.title || this.defaultTitle()}
|
|
63
68
|
</div>
|
|
@@ -191,6 +196,10 @@ __decorate([property({
|
|
|
191
196
|
}), __decorateMetadata("design:type", Object)], UAlert.prototype, "status", void 0);
|
|
192
197
|
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UAlert.prototype, "title", void 0);
|
|
193
198
|
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UAlert.prototype, "duration", void 0);
|
|
199
|
+
__decorate([property({
|
|
200
|
+
type: Boolean,
|
|
201
|
+
reflect: true
|
|
202
|
+
}), __decorateMetadata("design:type", Boolean)], UAlert.prototype, "inline", void 0);
|
|
194
203
|
UAlert = __decorate([customElement("u-alert")], UAlert);
|
|
195
204
|
//#endregion
|
|
196
205
|
export { ALERT_STATUSES, UAlert };
|
|
@@ -67,6 +67,22 @@ var styles = css`
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
|
|
70
|
+
:host([inline]) {
|
|
71
|
+
width: auto;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
max-height: none;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
transform: none;
|
|
76
|
+
transition: none;
|
|
77
|
+
}
|
|
78
|
+
:host([inline]:not([open])) {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
:host([inline]) .content {
|
|
82
|
+
overflow-y: visible;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
70
86
|
|
|
71
87
|
:host([appearance="soft"]) {
|
|
72
88
|
--alert-border-width: 1px;
|
|
@@ -103,10 +119,14 @@ var styles = css`
|
|
|
103
119
|
font-size: var(--u-text-subtitle-size, 16px);
|
|
104
120
|
user-select: none;
|
|
105
121
|
}
|
|
106
|
-
.header .icon
|
|
122
|
+
.header .icon,
|
|
123
|
+
.header ::slotted([slot="icon"]) {
|
|
107
124
|
flex-shrink: 0;
|
|
108
125
|
color: var(--alert-icon-color);
|
|
109
126
|
}
|
|
127
|
+
.icon-slot {
|
|
128
|
+
display: contents;
|
|
129
|
+
}
|
|
110
130
|
.header .title {
|
|
111
131
|
flex-grow: 1;
|
|
112
132
|
font-weight: 600;
|
|
@@ -22,7 +22,11 @@ var styles = css`
|
|
|
22
22
|
|
|
23
23
|
a {
|
|
24
24
|
display: inline-flex;
|
|
25
|
-
align-items: center
|
|
25
|
+
align-items: center;
|
|
26
|
+
|
|
27
|
+
justify-content: center;
|
|
28
|
+
min-height: var(--u-target-size, 0px);
|
|
29
|
+
min-width: var(--u-target-size, 0px);
|
|
26
30
|
gap: 0.2em;
|
|
27
31
|
color: inherit;
|
|
28
32
|
text-decoration: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
1
2
|
import { UElement } from '../UElement.js';
|
|
2
3
|
export type CardOrientation = 'vertical' | 'horizontal';
|
|
3
4
|
export type CardAppearance = 'outlined' | 'plain';
|
|
@@ -9,7 +10,7 @@ export type CardAppearance = 'outlined' | 'plain';
|
|
|
9
10
|
* @slot footer - 카드 하단 푸터 영역
|
|
10
11
|
* @slot media - 카드의 미디어 영역 (이미지, 동영상 등)
|
|
11
12
|
*
|
|
12
|
-
* @csspart base - 카드 바깥 상자
|
|
13
|
+
* @csspart base - 카드 바깥 상자(`href` 를 주면 이 상자가 링크 `<a>` 다)
|
|
13
14
|
* @csspart media - 미디어 영역 컨테이너
|
|
14
15
|
* @csspart content - 콘텐츠 영역 컨테이너
|
|
15
16
|
* @csspart header - 헤더 영역 컨테이너
|
|
@@ -28,7 +29,19 @@ export declare class UCard extends UElement {
|
|
|
28
29
|
appearance: CardAppearance;
|
|
29
30
|
/** 마우스 오버 효과 적용 여부 */
|
|
30
31
|
hoverable: boolean;
|
|
31
|
-
|
|
32
|
+
/**
|
|
33
|
+
* 카드 전체가 이동하는 링크 URL. 주면 바깥 상자가 `<a>` 로 그려진다 — 테두리가 hover 를 싣고 들어 올리지 않는다.
|
|
34
|
+
* 링크 안에는 다른 대화형 요소(버튼·링크)를 두지 않는다(HTML 의 `<a>` 내용 모델).
|
|
35
|
+
*/
|
|
36
|
+
href?: string;
|
|
37
|
+
/** 링크 타겟 (`href` 와 함께) */
|
|
38
|
+
target?: string;
|
|
39
|
+
/** 링크 관계 (`href` 와 함께) */
|
|
40
|
+
rel?: string;
|
|
41
|
+
/** 다운로드 파일명 (`href` 와 함께) */
|
|
42
|
+
download?: string;
|
|
43
|
+
render(): TemplateResult<1>;
|
|
44
|
+
private renderSections;
|
|
32
45
|
private handleSlotChange;
|
|
33
46
|
}
|
|
34
47
|
declare global {
|
|
@@ -4,6 +4,7 @@ import __decorate from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm
|
|
|
4
4
|
import { styles } from "./UCard.styles.js";
|
|
5
5
|
import { html } from "lit";
|
|
6
6
|
import { customElement, property } from "lit/decorators.js";
|
|
7
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
8
|
//#region src/components/card/UCard.ts
|
|
8
9
|
var UCard = class UCard extends UElement {
|
|
9
10
|
constructor(..._args) {
|
|
@@ -17,8 +18,22 @@ var UCard = class UCard extends UElement {
|
|
|
17
18
|
this.styles = [super.styles, styles];
|
|
18
19
|
}
|
|
19
20
|
render() {
|
|
21
|
+
if (this.href) {
|
|
22
|
+
const ariaLabel = this.getAttribute("aria-label") ?? void 0;
|
|
23
|
+
return html`
|
|
24
|
+
<a class="base" part="base"
|
|
25
|
+
href=${this.href}
|
|
26
|
+
aria-label=${ifDefined(ariaLabel)}
|
|
27
|
+
target=${ifDefined(this.target)}
|
|
28
|
+
rel=${ifDefined(this.rel)}
|
|
29
|
+
download=${ifDefined(this.download)}
|
|
30
|
+
>${this.renderSections()}</a>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
return html`<div class="base" part="base">${this.renderSections()}</div>`;
|
|
34
|
+
}
|
|
35
|
+
renderSections() {
|
|
20
36
|
return html`
|
|
21
|
-
<div class="base" part="base">
|
|
22
37
|
<div class="media" part="media">
|
|
23
38
|
<slot name="media" @slotchange=${this.handleSlotChange}></slot>
|
|
24
39
|
</div>
|
|
@@ -33,7 +48,6 @@ var UCard = class UCard extends UElement {
|
|
|
33
48
|
<slot name="footer" @slotchange=${this.handleSlotChange}></slot>
|
|
34
49
|
</footer>
|
|
35
50
|
</div>
|
|
36
|
-
</div>
|
|
37
51
|
`;
|
|
38
52
|
}
|
|
39
53
|
handleSlotChange(e) {
|
|
@@ -59,6 +73,13 @@ __decorate([property({
|
|
|
59
73
|
type: Boolean,
|
|
60
74
|
reflect: true
|
|
61
75
|
}), __decorateMetadata("design:type", Object)], UCard.prototype, "hoverable", void 0);
|
|
76
|
+
__decorate([property({
|
|
77
|
+
type: String,
|
|
78
|
+
reflect: true
|
|
79
|
+
}), __decorateMetadata("design:type", String)], UCard.prototype, "href", void 0);
|
|
80
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCard.prototype, "target", void 0);
|
|
81
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCard.prototype, "rel", void 0);
|
|
82
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCard.prototype, "download", void 0);
|
|
62
83
|
UCard = __decorate([customElement("u-card")], UCard);
|
|
63
84
|
//#endregion
|
|
64
85
|
export { UCard };
|
|
@@ -49,6 +49,24 @@ var styles = css`
|
|
|
49
49
|
box-shadow: var(--u-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.06));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
a.base {
|
|
55
|
+
color: inherit;
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: border-color var(--u-duration-fast, 140ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
59
|
+
}
|
|
60
|
+
a.base:hover {
|
|
61
|
+
--card-border-color: var(--u-border-color-strong, #BDBDBD);
|
|
62
|
+
}
|
|
63
|
+
a.base:focus-visible {
|
|
64
|
+
outline-offset: -2px;
|
|
65
|
+
}
|
|
66
|
+
@media (prefers-reduced-motion: reduce) {
|
|
67
|
+
a.base { transition: none; }
|
|
68
|
+
}
|
|
69
|
+
|
|
52
70
|
.media {
|
|
53
71
|
display: none;
|
|
54
72
|
flex-shrink: 0;
|
|
@@ -25,7 +25,9 @@ var styles = css`
|
|
|
25
25
|
width: 100%;
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
padding: var(--u-space-sm, 8px) var(--u-space-md, 12px);
|
|
28
|
-
border: none
|
|
28
|
+
border: none;
|
|
29
|
+
|
|
30
|
+
min-height: var(--u-target-size, 0px);
|
|
29
31
|
border-radius: inherit;
|
|
30
32
|
background: none;
|
|
31
33
|
color: var(--u-txt-color, #212121);
|
|
@@ -15,6 +15,10 @@ export type FieldDescriptionDisplay = 'inline' | 'hint';
|
|
|
15
15
|
*
|
|
16
16
|
* @slot - 폼 컨트롤 (input, select, textarea 등)
|
|
17
17
|
* @slot label-aside - 라벨 오른쪽 슬롯 영역 (숫자 표시, 알림 등)
|
|
18
|
+
* @csspart header - 라벨 줄(라벨 · 정보 아이콘 · `label-aside`)
|
|
19
|
+
* @csspart label - 라벨
|
|
20
|
+
* @csspart required - 필수 표시
|
|
21
|
+
* @csspart footer - 컨트롤 아래 줄(설명, 또는 `invalid` 일 때 검증 문구 — `u-field[invalid]::part(footer)` 로 가른다)
|
|
18
22
|
* @csspart hint - `description-display="hint"` 의 정보 아이콘 감싸개
|
|
19
23
|
* @csspart hint-tooltip - 그 툴팁
|
|
20
24
|
*/
|
|
@@ -108,9 +108,9 @@ var UField = class UField extends UElement {
|
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
110
|
return html`
|
|
111
|
-
<div class="header" ?hidden=${!this.label}>
|
|
112
|
-
<label class="label" @click=${this.handleLabelClick}>
|
|
113
|
-
<span class="required" ?hidden=${!this.required}>*</span>
|
|
111
|
+
<div class="header" part="header" ?hidden=${!this.label}>
|
|
112
|
+
<label class="label" part="label" @click=${this.handleLabelClick}>
|
|
113
|
+
<span class="required" part="required" ?hidden=${!this.required}>*</span>
|
|
114
114
|
${this.label}
|
|
115
115
|
</label>
|
|
116
116
|
${this.renderHint()}
|
|
@@ -168,7 +168,7 @@ var UField = class UField extends UElement {
|
|
|
168
168
|
renderFooter() {
|
|
169
169
|
const message = this.invalid && this.validationMessage ? this.validationMessage : this.effectiveDescriptionDisplay === "inline" ? this.description : void 0;
|
|
170
170
|
if (!message) return nothing;
|
|
171
|
-
return html`<div class="footer">${message}</div>`;
|
|
171
|
+
return html`<div class="footer" part="footer">${message}</div>`;
|
|
172
172
|
}
|
|
173
173
|
/** 슬롯에 꽂힌 첫 포커스 가능 자식으로 위임한다 — 라벨 클릭과 같은 대상 탐색 로직을
|
|
174
174
|
* 공개 API로도 노출해, 소비자가 임의의 폼 컨트롤(자체 웹 컴포넌트가 아닌 것 포함)을
|
|
@@ -23,7 +23,10 @@ var styles = css`
|
|
|
23
23
|
flex-direction: row;
|
|
24
24
|
align-items: center;
|
|
25
25
|
padding: 0.25em 0.5em;
|
|
26
|
-
padding-left: calc(var(--menu-indent-size) * var(--menu-item-depth) + 0.5em)
|
|
26
|
+
padding-left: calc(var(--menu-indent-size) * var(--menu-item-depth) + 0.5em);
|
|
27
|
+
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
min-height: var(--u-target-size, 0px);
|
|
27
30
|
background-color: transparent;
|
|
28
31
|
transition: background-color var(--u-duration-fast, 140ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)), color var(--u-duration-fast, 140ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
29
32
|
user-select: none;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
1
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import { UElement } from '../UElement.js';
|
|
3
3
|
/**
|
|
4
|
-
* 탭
|
|
4
|
+
* 탭 아이템 — `u-tab-panel` 안에서는 패널을 고르는 탭(`role="tab"`), `href` 를 주면 `u-tab-nav` 안의
|
|
5
|
+
* 이동 링크(저장된 보기 = URL)다. 링크 탭은 탭 역할을 갖지 않는다 — 다른 쪽으로 이동하는 것은 탭이 아니라
|
|
6
|
+
* 링크이고, 현재 쪽은 `aria-current="page"` 로 알린다(WAI-ARIA APG 는 탭 패턴을 «같은 쪽의 패널 전환» 에만 쓴다).
|
|
5
7
|
*
|
|
6
8
|
* @slot - 탭 레이블 콘텐츠
|
|
7
9
|
* @slot prefix - 탭 레이블 앞에 표시되는 콘텐츠
|
|
8
10
|
* @slot suffix - 탭 레이블 뒤에 표시되는 콘텐츠
|
|
9
11
|
*
|
|
10
|
-
* @csspart base - 탭 바깥 상자
|
|
12
|
+
* @csspart base - 탭 바깥 상자(`href` 를 주면 이 상자가 링크 `<a>` 다)
|
|
13
|
+
* @csspart count - 개수 (`count` 를 줄 때만 렌더된다)
|
|
11
14
|
* @csspart remove-btn - 탭 닫기 버튼
|
|
12
15
|
*
|
|
13
16
|
* @event remove - 탭이 닫힐 때 발생. 이벤트 리스너에서 preventDefault()를 호출하면 탭이 닫히지 않습니다.
|
|
@@ -24,9 +27,26 @@ export declare class UTab extends UElement {
|
|
|
24
27
|
value: string;
|
|
25
28
|
/** 탭 드래그 여부 */
|
|
26
29
|
draggable: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 선택된 탭 — 담는 쪽(`u-tab-panel` · `u-tab-nav` 의 `value`)이 정한다. `u-tab-nav` 에 `value` 가 없으면
|
|
32
|
+
* 작성자가 현재 보기의 링크 탭에 직접 둔다.
|
|
33
|
+
*/
|
|
34
|
+
active: boolean;
|
|
35
|
+
/** 이동할 URL — 주면 탭이 링크가 된다(`u-tab-nav` 안에 둔다). 링크 탭은 닫기 버튼을 그리지 않는다. */
|
|
36
|
+
href?: string;
|
|
37
|
+
/** 링크 타겟 (`href` 와 함께) */
|
|
38
|
+
target?: string;
|
|
39
|
+
/** 링크 관계 (`href` 와 함께) */
|
|
40
|
+
rel?: string;
|
|
41
|
+
/** 레이블 뒤의 조용한 개수(그 보기의 항목 수) — 현재 로캘의 숫자 표기로 그린다. 없으면 그리지 않는다. */
|
|
42
|
+
count?: number;
|
|
27
43
|
connectedCallback(): void;
|
|
44
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
28
45
|
protected updated(changedProperties: PropertyValues): void;
|
|
29
|
-
|
|
46
|
+
/** 탭이면 호스트가 `role="tab"` 이고 포커스를 받는다 · 링크면 둘 다 안쪽 `<a>` 의 것이다. */
|
|
47
|
+
private applyRole;
|
|
48
|
+
render(): TemplateResult<1>;
|
|
49
|
+
private renderLabel;
|
|
30
50
|
private handleRemoveClick;
|
|
31
51
|
}
|
|
32
52
|
declare global {
|
|
@@ -4,9 +4,11 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.153.0/hel
|
|
|
4
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
|
+
import { formatNumber } from "../../utilities/format.js";
|
|
7
8
|
import { styles } from "./UTab.styles.js";
|
|
8
|
-
import { html } from "lit";
|
|
9
|
+
import { html, nothing } from "lit";
|
|
9
10
|
import { customElement, property } from "lit/decorators.js";
|
|
11
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
12
|
//#region src/components/tab/UTab.ts
|
|
11
13
|
var UTab = class UTab extends UElement {
|
|
12
14
|
constructor(..._args) {
|
|
@@ -15,6 +17,7 @@ var UTab = class UTab extends UElement {
|
|
|
15
17
|
this.removable = false;
|
|
16
18
|
this.value = "";
|
|
17
19
|
this.draggable = false;
|
|
20
|
+
this.active = false;
|
|
18
21
|
this.handleRemoveClick = (e) => {
|
|
19
22
|
e.stopPropagation();
|
|
20
23
|
if (this.disabled) return;
|
|
@@ -29,23 +32,44 @@ var UTab = class UTab extends UElement {
|
|
|
29
32
|
}
|
|
30
33
|
connectedCallback() {
|
|
31
34
|
super.connectedCallback();
|
|
32
|
-
this.
|
|
33
|
-
if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
35
|
+
this.applyRole();
|
|
34
36
|
if (!this.hasAttribute("slot")) this.setAttribute("slot", "tab");
|
|
35
37
|
}
|
|
38
|
+
willUpdate(changedProperties) {
|
|
39
|
+
super.willUpdate(changedProperties);
|
|
40
|
+
if (changedProperties.has("href")) this.applyRole();
|
|
41
|
+
}
|
|
36
42
|
updated(changedProperties) {
|
|
37
43
|
super.updated(changedProperties);
|
|
38
|
-
if (changedProperties.has("disabled")) {
|
|
39
|
-
if (this.disabled) this.setAttribute("aria-disabled", "true");
|
|
44
|
+
if (changedProperties.has("disabled") || changedProperties.has("href")) {
|
|
45
|
+
if (this.disabled && !this.href) this.setAttribute("aria-disabled", "true");
|
|
40
46
|
else this.removeAttribute("aria-disabled");
|
|
41
47
|
}
|
|
42
48
|
}
|
|
49
|
+
/** 탭이면 호스트가 `role="tab"` 이고 포커스를 받는다 · 링크면 둘 다 안쪽 `<a>` 의 것이다. */
|
|
50
|
+
applyRole() {
|
|
51
|
+
if (this.href) {
|
|
52
|
+
if (this.getAttribute("role") === "tab") this.removeAttribute("role");
|
|
53
|
+
this.removeAttribute("tabindex");
|
|
54
|
+
this.removeAttribute("aria-selected");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.setAttribute("role", "tab");
|
|
58
|
+
if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
59
|
+
}
|
|
43
60
|
render() {
|
|
61
|
+
if (this.href) return html`
|
|
62
|
+
<a class="base" part="base"
|
|
63
|
+
href=${ifDefined(this.disabled ? void 0 : this.href)}
|
|
64
|
+
aria-current=${this.active ? "page" : nothing}
|
|
65
|
+
aria-disabled=${this.disabled ? "true" : nothing}
|
|
66
|
+
target=${ifDefined(this.target)}
|
|
67
|
+
rel=${ifDefined(this.rel)}
|
|
68
|
+
>${this.renderLabel()}</a>
|
|
69
|
+
`;
|
|
44
70
|
return html`
|
|
45
71
|
<div class="base" part="base">
|
|
46
|
-
|
|
47
|
-
<slot></slot>
|
|
48
|
-
<slot name="suffix"></slot>
|
|
72
|
+
${this.renderLabel()}
|
|
49
73
|
|
|
50
74
|
<u-button class="remove-btn" part="remove-btn"
|
|
51
75
|
?hidden=${!this.removable}
|
|
@@ -58,6 +82,14 @@ var UTab = class UTab extends UElement {
|
|
|
58
82
|
</div>
|
|
59
83
|
`;
|
|
60
84
|
}
|
|
85
|
+
renderLabel() {
|
|
86
|
+
return html`
|
|
87
|
+
<slot name="prefix"></slot>
|
|
88
|
+
<slot></slot>
|
|
89
|
+
${this.count == null || Number.isNaN(this.count) ? nothing : html`<span class="count" part="count">${formatNumber(this.count)}</span>`}
|
|
90
|
+
<slot name="suffix"></slot>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
61
93
|
};
|
|
62
94
|
__decorate([property({
|
|
63
95
|
type: Boolean,
|
|
@@ -75,6 +107,17 @@ __decorate([property({
|
|
|
75
107
|
type: Boolean,
|
|
76
108
|
reflect: true
|
|
77
109
|
}), __decorateMetadata("design:type", Object)], UTab.prototype, "draggable", void 0);
|
|
110
|
+
__decorate([property({
|
|
111
|
+
type: Boolean,
|
|
112
|
+
reflect: true
|
|
113
|
+
}), __decorateMetadata("design:type", Object)], UTab.prototype, "active", void 0);
|
|
114
|
+
__decorate([property({
|
|
115
|
+
type: String,
|
|
116
|
+
reflect: true
|
|
117
|
+
}), __decorateMetadata("design:type", String)], UTab.prototype, "href", void 0);
|
|
118
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UTab.prototype, "target", void 0);
|
|
119
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UTab.prototype, "rel", void 0);
|
|
120
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UTab.prototype, "count", void 0);
|
|
78
121
|
UTab = __decorate([customElement("u-tab")], UTab);
|
|
79
122
|
//#endregion
|
|
80
123
|
export { UTab };
|
|
@@ -23,7 +23,9 @@ var styles = css`
|
|
|
23
23
|
display: inline-flex;
|
|
24
24
|
flex-direction: row;
|
|
25
25
|
align-items: center;
|
|
26
|
-
padding: var(--tab-padding-block) var(--tab-padding-inline)
|
|
26
|
+
padding: var(--tab-padding-block) var(--tab-padding-inline);
|
|
27
|
+
|
|
28
|
+
min-height: var(--u-target-size, 0px);
|
|
27
29
|
border-radius: inherit;
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -42,6 +44,36 @@ var styles = css`
|
|
|
42
44
|
margin-left: 0.2em;
|
|
43
45
|
}
|
|
44
46
|
|
|
47
|
+
|
|
48
|
+
a.base {
|
|
49
|
+
color: inherit;
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
cursor: inherit;
|
|
52
|
+
}
|
|
53
|
+
a.base:focus-visible {
|
|
54
|
+
outline-offset: -2px;
|
|
55
|
+
}
|
|
56
|
+
a.base:not([href]) {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
.count {
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
margin-left: 0.45em;
|
|
64
|
+
min-width: 1.8em;
|
|
65
|
+
padding: 0 0.5em;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
border-radius: var(--u-radius-pill, 9999px);
|
|
68
|
+
background-color: var(--u-bg-color-raised, #FAFAFA);
|
|
69
|
+
color: var(--u-txt-color-weak, #616161);
|
|
70
|
+
font-size: var(--u-text-overline-size, 11px);
|
|
71
|
+
line-height: calc(var(--u-text-overline-leading, 1.45) * 1em);
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
font-variant-numeric: tabular-nums;
|
|
74
|
+
text-align: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
45
77
|
.remove-btn {
|
|
46
78
|
flex-shrink: 0;
|
|
47
79
|
margin-left: 0.2em;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { UElement } from '../UElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* 이동 링크의 탭 띠 — 저장된 보기(«열림 · 내 것 · 이번 주») 처럼 탭마다 URL 이 있는 자리.
|
|
5
|
+
*
|
|
6
|
+
* `u-tab-panel` 과 다른 일이다: 그것은 같은 쪽 안의 패널을 고르는 탭(`tablist`)이고, 이것은 다른 URL 로 가는
|
|
7
|
+
* 링크의 `<nav>` 랜드마크다. 그래서 탭은 링크(`<u-tab href>`)로 그려지고, 현재 보기는 `aria-current="page"`
|
|
8
|
+
* 로 알리며, 각 링크가 Tab 정지점이다(탭 목록의 화살표 이동은 링크 묶음에 쓰지 않는다 — WAI-ARIA APG).
|
|
9
|
+
*
|
|
10
|
+
* @slot - `u-tab href` 요소들(탭은 붙을 때 스스로 `slot="tab"` 을 단다 — 두 슬롯이 같은 자리에 그린다)
|
|
11
|
+
*
|
|
12
|
+
* @csspart base - `<nav>` 띠
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --tab-nav-color - 현재 탭의 글자·밑줄 색 (기본: --u-primary-color)
|
|
15
|
+
*/
|
|
16
|
+
export declare class UTabNav extends UElement {
|
|
17
|
+
static styles: import('lit').CSSResultGroup[];
|
|
18
|
+
/**
|
|
19
|
+
* 현재 보기 — 같은 `value` 의 탭이 `active` 가 된다. 비워 두면 담긴 탭의 `active` 를 건드리지 않는다
|
|
20
|
+
* (작성자가 현재 탭에 `active` 를 직접 둔다).
|
|
21
|
+
*/
|
|
22
|
+
value: string;
|
|
23
|
+
/** 띠의 접근 가능한 이름 — 랜드마크가 여럿인 쪽에서 «무엇의 보기인가» 를 가른다(예: `Saved views`). */
|
|
24
|
+
label: string;
|
|
25
|
+
private tabs;
|
|
26
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
27
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
+
private handleSlotChange;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'u-tab-nav': UTabNav;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UElement } from "../UElement.js";
|
|
2
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.js";
|
|
3
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.js";
|
|
4
|
+
import { UTab } from "../tab/UTab.js";
|
|
5
|
+
import { styles } from "./UTabNav.styles.js";
|
|
6
|
+
import { html, nothing } from "lit";
|
|
7
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
8
|
+
//#region src/components/tab-nav/UTabNav.ts
|
|
9
|
+
var UTabNav = class UTabNav extends UElement {
|
|
10
|
+
constructor(..._args) {
|
|
11
|
+
super(..._args);
|
|
12
|
+
this.value = "";
|
|
13
|
+
this.label = "";
|
|
14
|
+
this.tabs = [];
|
|
15
|
+
this.handleSlotChange = () => {
|
|
16
|
+
const slots = [...this.renderRoot.querySelectorAll("slot")];
|
|
17
|
+
this.tabs = slots.flatMap((s) => s.assignedElements({ flatten: true })).filter((el) => el instanceof UTab);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [super.styles, styles];
|
|
22
|
+
}
|
|
23
|
+
willUpdate(changedProperties) {
|
|
24
|
+
super.willUpdate(changedProperties);
|
|
25
|
+
if ((changedProperties.has("value") || changedProperties.has("tabs")) && this.value) for (const tab of this.tabs) tab.active = tab.value === this.value;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html`
|
|
29
|
+
<nav class="base" part="base" aria-label=${this.label || nothing}>
|
|
30
|
+
<slot name="tab" @slotchange=${this.handleSlotChange}></slot>
|
|
31
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
32
|
+
</nav>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
__decorate([property({
|
|
37
|
+
type: String,
|
|
38
|
+
reflect: true
|
|
39
|
+
}), __decorateMetadata("design:type", Object)], UTabNav.prototype, "value", void 0);
|
|
40
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", Object)], UTabNav.prototype, "label", void 0);
|
|
41
|
+
__decorate([state(), __decorateMetadata("design:type", Array)], UTabNav.prototype, "tabs", void 0);
|
|
42
|
+
UTabNav = __decorate([customElement("u-tab-nav")], UTabNav);
|
|
43
|
+
//#endregion
|
|
44
|
+
export { UTabNav };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/tab-nav/UTabNav.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
--tab-nav-color: var(--u-primary-color, #1976D2);
|
|
6
|
+
|
|
7
|
+
display: block;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
color: var(--u-txt-color, #212121);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
.base {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: stretch;
|
|
17
|
+
gap: var(--u-space-2xs, 4px);
|
|
18
|
+
box-shadow: inset 0 -1px 0 var(--u-border-color, #E0E0E0);
|
|
19
|
+
overflow-x: auto;
|
|
20
|
+
overflow-y: hidden;
|
|
21
|
+
scrollbar-width: thin;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
::slotted(u-tab[active]) {
|
|
25
|
+
color: var(--tab-nav-color);
|
|
26
|
+
}
|
|
27
|
+
::slotted(u-tab[active])::after {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
height: 2px;
|
|
34
|
+
background-color: var(--tab-nav-color);
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { styles };
|
|
@@ -7,6 +7,8 @@ export type TagAppearance = "solid" | "soft" | "outlined" | "plain";
|
|
|
7
7
|
* *색 자체*를 말하고 리브랜딩에 의도적으로 면역이다. `neutral`(기본)은 **무채색**이다.
|
|
8
8
|
*/
|
|
9
9
|
export type TagColor = "neutral" | "primary" | "info" | "success" | "warning" | "danger" | "blue" | "green" | "yellow" | "red" | "orange" | "teal" | "cyan" | "purple" | "pink";
|
|
10
|
+
/** 크기 — `md`(기본: 캡션 글자) · `sm`(오버라인 글자 · 세로 여백 없음 — 표 칸의 식별자 옆 속성처럼 글줄 안에 앉는 작은 표식). */
|
|
11
|
+
export type TagSize = "sm" | "md";
|
|
10
12
|
/**
|
|
11
13
|
* 레이블, 카테고리, 상태 등을 표시하는 태그 컴포넌트입니다.
|
|
12
14
|
*
|
|
@@ -33,6 +35,8 @@ export declare class UTag extends UElement {
|
|
|
33
35
|
appearance: TagAppearance;
|
|
34
36
|
/** 태그의 색상을 설정합니다. */
|
|
35
37
|
color: TagColor;
|
|
38
|
+
/** 크기 */
|
|
39
|
+
size: TagSize;
|
|
36
40
|
/** 태그를 둥글게 표시합니다. */
|
|
37
41
|
rounded: boolean;
|
|
38
42
|
/**
|
|
@@ -12,6 +12,7 @@ var UTag = class UTag extends UElement {
|
|
|
12
12
|
super(..._args);
|
|
13
13
|
this.appearance = "soft";
|
|
14
14
|
this.color = "neutral";
|
|
15
|
+
this.size = "md";
|
|
15
16
|
this.rounded = false;
|
|
16
17
|
this.icon = false;
|
|
17
18
|
this.dot = false;
|
|
@@ -41,6 +42,10 @@ __decorate([property({
|
|
|
41
42
|
type: String,
|
|
42
43
|
reflect: true
|
|
43
44
|
}), __decorateMetadata("design:type", Object)], UTag.prototype, "color", void 0);
|
|
45
|
+
__decorate([property({
|
|
46
|
+
type: String,
|
|
47
|
+
reflect: true
|
|
48
|
+
}), __decorateMetadata("design:type", Object)], UTag.prototype, "size", void 0);
|
|
44
49
|
__decorate([property({
|
|
45
50
|
type: Boolean,
|
|
46
51
|
reflect: true
|
|
@@ -187,6 +187,18 @@ var styles = css`
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
:host([size="sm"]) {
|
|
193
|
+
font-size: var(--u-text-overline-size, 11px);
|
|
194
|
+
line-height: calc(var(--u-text-overline-leading, 1.45) * 1em);
|
|
195
|
+
--tag-padding-block: 0;
|
|
196
|
+
--tag-padding-inline: 0.45em;
|
|
197
|
+
--tag-gap: 0.35em;
|
|
198
|
+
--tag-dot-size: 5px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
190
202
|
.base {
|
|
191
203
|
box-sizing: border-box;
|
|
192
204
|
width: 100%;
|
|
@@ -26,7 +26,10 @@ var styles = css`
|
|
|
26
26
|
padding-left: calc(
|
|
27
27
|
var(--tree-indent-size) * var(--tree-item-depth)
|
|
28
28
|
+ var(--tree-indent-guide-offset)
|
|
29
|
-
)
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
min-height: var(--u-target-size, 0px);
|
|
30
33
|
transition: background-color var(--u-duration-fast, 140ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)), color var(--u-duration-fast, 140ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
31
34
|
user-select: none;
|
|
32
35
|
cursor: pointer;
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from './components/steps/USteps.js';
|
|
|
45
45
|
export * from './components/switch/USwitch.js';
|
|
46
46
|
export * from './components/tab/UTab.js';
|
|
47
47
|
export * from './components/tab-panel/UTabPanel.js';
|
|
48
|
+
export * from './components/tab-nav/UTabNav.js';
|
|
48
49
|
export * from './components/tag/UTag.js';
|
|
49
50
|
export * from './components/text/UText.js';
|
|
50
51
|
export * from './components/textarea/UTextarea.js';
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ import { USteps } from "./components/steps/USteps.js";
|
|
|
58
58
|
import { USwitch } from "./components/switch/USwitch.js";
|
|
59
59
|
import { UTab } from "./components/tab/UTab.js";
|
|
60
60
|
import { UTabPanel } from "./components/tab-panel/UTabPanel.js";
|
|
61
|
+
import { UTabNav } from "./components/tab-nav/UTabNav.js";
|
|
61
62
|
import { UText } from "./components/text/UText.js";
|
|
62
63
|
import { UTextarea } from "./components/textarea/UTextarea.js";
|
|
63
64
|
import { UTreeItem } from "./components/tree-item/UTreeItem.js";
|
|
@@ -68,4 +69,4 @@ import { Dialog } from "./utilities/Dialog.js";
|
|
|
68
69
|
import { Theme } from "./utilities/Theme.js";
|
|
69
70
|
import { Toast } from "./utilities/Toast.js";
|
|
70
71
|
import { decodeDelimited, decodeTsv, encodeTsv } from "./utilities/tsv.js";
|
|
71
|
-
export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, devWarnOnce, encodeTsv, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, hangulKeystrokes, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
|
|
72
|
+
export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabNav, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, devWarnOnce, encodeTsv, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, hangulKeystrokes, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UTabNav as UTabNavElement } from '@iyulab/components/dist/components/tab-nav/UTabNav.js';
|
|
3
|
+
|
|
4
|
+
type UTabNavOwnProps = Omit<UTabNavElement, keyof HTMLElement>;
|
|
5
|
+
|
|
6
|
+
export declare const UTabNav: React.ForwardRefExoticComponent<
|
|
7
|
+
Partial<Omit<UTabNavElement, Exclude<keyof React.HTMLAttributes<UTabNavElement>, keyof UTabNavOwnProps>>>
|
|
8
|
+
& Omit<React.HTMLAttributes<UTabNavElement>, keyof UTabNavOwnProps | never>
|
|
9
|
+
& React.RefAttributes<UTabNavElement>
|
|
10
|
+
& {
|
|
11
|
+
}
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export type UTabNavProps = React.ComponentProps<typeof UTabNav>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { UTabNav as UTabNavElement } from '@iyulab/components/dist/components/tab-nav/UTabNav.js';
|
|
4
|
+
|
|
5
|
+
export const UTabNav = createComponent({
|
|
6
|
+
react: React,
|
|
7
|
+
tagName: 'u-tab-nav',
|
|
8
|
+
elementClass: UTabNavElement,
|
|
9
|
+
events: {},
|
|
10
|
+
});
|
package/dist/react/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { UTextarea, UTextareaProps } from './UTextarea';
|
|
|
5
5
|
export { UText, UTextProps } from './UText';
|
|
6
6
|
export { UTag, UTagProps } from './UTag';
|
|
7
7
|
export { UTabPanel, UTabPanelProps } from './UTabPanel';
|
|
8
|
+
export { UTabNav, UTabNavProps } from './UTabNav';
|
|
8
9
|
export { UTab, UTabProps } from './UTab';
|
|
9
10
|
export { USwitch, USwitchProps } from './USwitch';
|
|
10
11
|
export { USteps, UStepsProps } from './USteps';
|
package/dist/react/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { UTextarea } from './UTextarea.js';
|
|
|
5
5
|
export { UText } from './UText.js';
|
|
6
6
|
export { UTag } from './UTag.js';
|
|
7
7
|
export { UTabPanel } from './UTabPanel.js';
|
|
8
|
+
export { UTabNav } from './UTabNav.js';
|
|
8
9
|
export { UTab } from './UTab.js';
|
|
9
10
|
export { USwitch } from './USwitch.js';
|
|
10
11
|
export { USteps } from './USteps.js';
|
package/package.json
CHANGED
|
@@ -109,7 +109,8 @@ set on the host yourself always wins and is never overwritten.
|
|
|
109
109
|
- [`u-menu`](./references/components/menu.md) — Menu container with keyboard navigation and selection modes
|
|
110
110
|
- [`u-menu-item`](./references/components/menu.md) — Menu entry with optional sub-menu
|
|
111
111
|
- [`u-tab-panel`](./references/components/tab-panel.md) — Tab-based content switcher
|
|
112
|
-
- [`u-tab`](./references/components/tab-panel.md) — Individual tab button used inside `u-tab-panel`
|
|
112
|
+
- [`u-tab`](./references/components/tab-panel.md) — Individual tab button used inside `u-tab-panel`; with `href`, a link tab for `u-tab-nav`
|
|
113
|
+
- [`u-tab-nav`](./references/components/tab-nav.md) — Tab strip of links (saved views): a `<nav>` with `aria-current`, not a tablist
|
|
113
114
|
- [`u-tree`](./references/components/tree.md) — Hierarchical tree with select, check, and drag-and-drop
|
|
114
115
|
- [`u-tree-item`](./references/components/tree.md) — Individual node inside `u-tree`
|
|
115
116
|
|
|
@@ -17,8 +17,24 @@ Closable message banner with status icons, auto-dismiss timer, and open/hide tra
|
|
|
17
17
|
Failed to load data.
|
|
18
18
|
<u-button slot="footer" appearance="solid">Retry</u-button>
|
|
19
19
|
</u-alert>
|
|
20
|
+
|
|
21
|
+
<!-- In the page flow (a callout, an error summary): fills its place, no floating shadow -->
|
|
22
|
+
<u-alert inline open status="info" title="Totals follow the filters above">
|
|
23
|
+
Clear a filter chip to widen them.
|
|
24
|
+
</u-alert>
|
|
25
|
+
|
|
26
|
+
<!-- A static note is not a live region: set the role, and swap the icon -->
|
|
27
|
+
<u-alert inline open status="notice" role="note" title="Note">
|
|
28
|
+
<u-icon slot="icon" lib="bootstrap" name="pencil"></u-icon>
|
|
29
|
+
Customer asked for the same cover as last year.
|
|
30
|
+
</u-alert>
|
|
20
31
|
```
|
|
21
32
|
|
|
33
|
+
Without `inline` the alert has the floating look a toast uses (content width, large shadow, scale transition) and
|
|
34
|
+
keeps its place while closed. `inline` is for an alert that sits in the page: it fills its container, drops the
|
|
35
|
+
shadow and the transition, and takes no space while closed. The role follows `status` (`error`/`warning` →
|
|
36
|
+
`alert`, otherwise `status`) unless you set one — a role you set is kept.
|
|
37
|
+
|
|
22
38
|
---
|
|
23
39
|
|
|
24
40
|
## Slots
|
|
@@ -27,6 +43,7 @@ Closable message banner with status icons, auto-dismiss timer, and open/hide tra
|
|
|
27
43
|
|------|-------------|
|
|
28
44
|
| *(default)* | Alert body content |
|
|
29
45
|
| `footer` | Bottom area (e.g. action buttons) |
|
|
46
|
+
| `icon` | Replaces the status icon (e.g. a pencil on a note); left empty, the status icon shows |
|
|
30
47
|
|
|
31
48
|
## Properties
|
|
32
49
|
|
|
@@ -38,6 +55,7 @@ Closable message banner with status icons, auto-dismiss timer, and open/hide tra
|
|
|
38
55
|
| `status` | `'error'\|'warning'\|'success'\|'info'\|'notice'` | — | ✓ | Status type; controls icon, color and role (`error`/`warning` are `role="alert"`). An outcome word, not a palette word — buttons and badges say `color="danger"`, an alert says `status="error"`; an unknown value renders as a neutral notice and warns in development, naming the likely word |
|
|
39
56
|
| `title` | `string` | `''` | — | Title label. Left empty, the status name in the current locale is shown (`Locale.set('ko')` → 「오류」), not the raw status value |
|
|
40
57
|
| `duration` | `number` | `0` | — | Auto-dismiss delay in ms; `0` disables |
|
|
58
|
+
| `inline` | `boolean` | `false` | ✓ | In the page flow: fills its container, no floating shadow or scale transition, no space while closed |
|
|
41
59
|
|
|
42
60
|
## Events
|
|
43
61
|
|
|
@@ -20,8 +20,19 @@ Content card with optional media, header, body, and footer sections.
|
|
|
20
20
|
<img slot="media" src="/thumb.jpg" />
|
|
21
21
|
<p>Horizontal layout card.</p>
|
|
22
22
|
</u-card>
|
|
23
|
+
|
|
24
|
+
<!-- The whole card is a link -->
|
|
25
|
+
<u-card href="/orders/42" aria-label="Order 42">
|
|
26
|
+
<span slot="header">Order 42</span>
|
|
27
|
+
<p>Due Oct 20 · 3 items</p>
|
|
28
|
+
</u-card>
|
|
23
29
|
```
|
|
24
30
|
|
|
31
|
+
**A card that is a link (`href`).** The outer box renders as an `<a>`: the text stays ink with no underline, the
|
|
32
|
+
border carries hover, and the card does not lift (a lifting card shakes a grid row). Keep other interactive elements
|
|
33
|
+
— buttons, links — out of a link card; an `<a>` cannot contain them. The link's accessible name is all of the card's
|
|
34
|
+
text unless the host has an `aria-label`, which moves to the link.
|
|
35
|
+
|
|
25
36
|
---
|
|
26
37
|
|
|
27
38
|
## Slots
|
|
@@ -41,12 +52,16 @@ Content card with optional media, header, body, and footer sections.
|
|
|
41
52
|
| `shadowless` | `boolean` | `false` | ✓ | Remove drop shadow |
|
|
42
53
|
| `appearance` | `'outlined'\|'plain'` | `'outlined'` | ✓ | `outlined` border and drop shadow · `plain` no border and no shadow (layout only) |
|
|
43
54
|
| `hoverable` | `boolean` | `false` | ✓ | Lift effect on hover |
|
|
55
|
+
| `href` | `string` | — | ✓ | Makes the whole card a link to this URL |
|
|
56
|
+
| `target` | `string` | — | | Link target (with `href`) |
|
|
57
|
+
| `rel` | `string` | — | | Link relationship (with `href`) |
|
|
58
|
+
| `download` | `string` | — | | Download file name (with `href`) |
|
|
44
59
|
|
|
45
60
|
## CSS Parts
|
|
46
61
|
|
|
47
62
|
| Part | Description |
|
|
48
63
|
|------|-------------|
|
|
49
|
-
| `base` | Outer card box |
|
|
64
|
+
| `base` | Outer card box — the `<a>` when `href` is set |
|
|
50
65
|
| `media` | Media area wrapper |
|
|
51
66
|
| `content` | Full content wrapper (header + body + footer) |
|
|
52
67
|
| `header` | Header slot wrapper |
|
|
@@ -112,6 +112,10 @@ is not a Tab stop — a form of dozens of fields would otherwise double its Tabs
|
|
|
112
112
|
|
|
113
113
|
| Part | Description |
|
|
114
114
|
|------|-------------|
|
|
115
|
+
| `header` | The label row (label · info icon · `label-aside`) |
|
|
116
|
+
| `label` | The label |
|
|
117
|
+
| `required` | The required marker |
|
|
118
|
+
| `footer` | The line under the control — the description, or the validation message while `invalid` (tell them apart with `u-field[invalid]::part(footer)`) |
|
|
115
119
|
| `hint` | The info icon beside the label (`description-display="hint"`) |
|
|
116
120
|
| `hint-tooltip` | The tooltip that holds the description |
|
|
117
121
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# u-tab-nav
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import '@iyulab/components/dist/components/tab-nav/UTabNav.js';
|
|
5
|
+
import '@iyulab/components/dist/components/tab/UTab.js';
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
**Tags:** `u-tab-nav`, `u-tab` (with `href`)
|
|
9
|
+
|
|
10
|
+
A tab strip of **links** — saved views, sections of a record, anything where each tab is a URL. It looks like the
|
|
11
|
+
`line` appearance of [`u-tab-panel`](./tab-panel.md) but does a different job: `u-tab-panel` switches panels on the
|
|
12
|
+
same page (a `tablist`), `u-tab-nav` takes you to another URL (a `<nav>` landmark).
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<u-tab-nav label="Saved views" value="open">
|
|
16
|
+
<u-tab value="all" href="?view=all">All</u-tab>
|
|
17
|
+
<u-tab value="open" href="?view=open" count="12">Open</u-tab>
|
|
18
|
+
<u-tab value="mine" href="?view=mine" count="3">Mine</u-tab>
|
|
19
|
+
</u-tab-nav>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Each `u-tab` needs an `href`. Mark the current view with `value` on the strip (the tab with the same `value` becomes
|
|
23
|
+
`active`), or leave `value` empty and put `active` on the current tab yourself. With a router, set `value` from the
|
|
24
|
+
route.
|
|
25
|
+
|
|
26
|
+
### Accessibility
|
|
27
|
+
|
|
28
|
+
- The strip is a `<nav>` named by `label` — give it one when the page has other navigation.
|
|
29
|
+
- Each tab is a link, and each link is a Tab stop; Enter follows it. There are no arrow keys and no tab role — the
|
|
30
|
+
WAI-ARIA tabs pattern is for panels on one page, and a link announced as a «tab» promises a panel that never
|
|
31
|
+
appears.
|
|
32
|
+
- The current tab carries `aria-current="page"`.
|
|
33
|
+
- A disabled link tab has no `href` and reports `aria-disabled`.
|
|
34
|
+
- A `count` is part of the link's name («Open 12»).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Properties
|
|
39
|
+
|
|
40
|
+
| Property | Type | Default | Reflect | Description |
|
|
41
|
+
|----------|------|---------|---------|-------------|
|
|
42
|
+
| `value` | `string` | `''` | ✓ | The current view — the tab with this `value` becomes `active`. Empty leaves `active` to the tabs |
|
|
43
|
+
| `label` | `string` | `''` | | Accessible name of the navigation landmark |
|
|
44
|
+
|
|
45
|
+
`u-tab` properties for link tabs (`href`, `target`, `rel`, `active`, `count`) are in [tab-panel.md](./tab-panel.md#u-tab).
|
|
46
|
+
|
|
47
|
+
## Slots
|
|
48
|
+
|
|
49
|
+
| Name | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| *(default)* | `u-tab` elements with `href` |
|
|
52
|
+
|
|
53
|
+
## CSS Parts
|
|
54
|
+
|
|
55
|
+
| Part | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `base` | The `<nav>` strip |
|
|
58
|
+
|
|
59
|
+
## CSS Custom Properties
|
|
60
|
+
|
|
61
|
+
| Property | Description |
|
|
62
|
+
|----------|-------------|
|
|
63
|
+
| `--tab-nav-color` | Text and underline colour of the current tab (default: `--u-primary-color`) |
|
|
@@ -8,7 +8,8 @@ import '@iyulab/components/dist/components/panel/UPanel.js';
|
|
|
8
8
|
|
|
9
9
|
**Tags:** `u-tab-panel`, `u-tab`
|
|
10
10
|
|
|
11
|
-
Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `value`.
|
|
11
|
+
Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `value`. For tabs that are links to other
|
|
12
|
+
URLs (saved views), use [`u-tab-nav`](./tab-nav.md).
|
|
12
13
|
|
|
13
14
|
```html
|
|
14
15
|
<u-tab-panel value="home">
|
|
@@ -104,6 +105,12 @@ selected tab is a tab stop (arrow keys, Home and End move between tabs and selec
|
|
|
104
105
|
A control placed in a slot (a button, a link) keeps its own keys and clicks — it does not select or
|
|
105
106
|
activate the tab, and the tab's arrow-key navigation applies only while the tab itself has focus.
|
|
106
107
|
|
|
108
|
+
**Link tabs.** With `href` the tab renders as a link for [`u-tab-nav`](./tab-nav.md): no tab role and no host tab
|
|
109
|
+
stop (the inner `<a>` is the stop), `aria-current="page"` while `active`, and no remove button.
|
|
110
|
+
|
|
111
|
+
**Count.** `count` draws a quiet number after the label — smaller, weaker, tabular digits in the active locale — in a
|
|
112
|
+
panel tab or a link tab. It is part of the tab's name.
|
|
113
|
+
|
|
107
114
|
### Properties
|
|
108
115
|
|
|
109
116
|
| Property | Type | Default | Reflect | Description |
|
|
@@ -112,6 +119,11 @@ activate the tab, and the tab's arrow-key navigation applies only while the tab
|
|
|
112
119
|
| `disabled` | `boolean` | `false` | ✓ | Disable the tab |
|
|
113
120
|
| `removable` | `boolean` | `false` | ✓ | Show close/remove button |
|
|
114
121
|
| `draggable` | `boolean` | `false` | ✓ | Native drag attribute — **no built-in reordering** |
|
|
122
|
+
| `active` | `boolean` | `false` | ✓ | The selected tab — set by the container's `value`; set it yourself on a link tab when `u-tab-nav` has no `value` |
|
|
123
|
+
| `href` | `string` | — | ✓ | Makes the tab a link (inside `u-tab-nav`) |
|
|
124
|
+
| `target` | `string` | — | | Link target (with `href`) |
|
|
125
|
+
| `rel` | `string` | — | | Link relationship (with `href`) |
|
|
126
|
+
| `count` | `number` | — | | Quiet count after the label, in the active locale's digits |
|
|
115
127
|
|
|
116
128
|
### Events
|
|
117
129
|
|
|
@@ -123,4 +135,6 @@ activate the tab, and the tab's arrow-key navigation applies only while the tab
|
|
|
123
135
|
|
|
124
136
|
| Part | Description |
|
|
125
137
|
|------|-------------|
|
|
138
|
+
| `base` | Tab box — the `<a>` when `href` is set |
|
|
139
|
+
| `count` | The count (only with `count`) |
|
|
126
140
|
| `remove-btn` | Remove button |
|
|
@@ -14,6 +14,9 @@ Non-interactive label tag for categories, status, or metadata display.
|
|
|
14
14
|
<u-tag color="green" rounded>Active</u-tag>
|
|
15
15
|
<u-tag color="success" dot>Shipped</u-tag>
|
|
16
16
|
|
|
17
|
+
<!-- A small mark inside a line of text — an attribute next to an id in a table cell -->
|
|
18
|
+
<a href="/orders/42">SO-42</a> <u-tag size="sm" appearance="outlined">Rush</u-tag>
|
|
19
|
+
|
|
17
20
|
<!-- With icon prefix -->
|
|
18
21
|
<u-tag color="red">
|
|
19
22
|
<u-icon slot="prefix" lib="tabler" name="alert-circle"></u-icon>
|
|
@@ -23,6 +26,10 @@ Non-interactive label tag for categories, status, or metadata display.
|
|
|
23
26
|
|
|
24
27
|
For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
|
|
25
28
|
|
|
29
|
+
**`size="sm"`** sits inside a line of text: the overline text size (`--u-text-overline-size`) and its leading, no
|
|
30
|
+
block padding — about 18px with the border, so it does not grow a dense table row. It carries no letter spacing (the
|
|
31
|
+
overline tracking assumes Latin labels).
|
|
32
|
+
|
|
26
33
|
---
|
|
27
34
|
|
|
28
35
|
## Slots
|
|
@@ -42,6 +49,7 @@ For interactive chips (selectable/removable), use [`u-chip`](./chip.md) instead.
|
|
|
42
49
|
| `rounded` | `boolean` | `false` | ✓ | Pill shape |
|
|
43
50
|
| `icon` | `boolean` | `false` | ✓ | Adds a status icon so the meaning survives without color (`info`/`success`/`warning`/`danger` only) |
|
|
44
51
|
| `dot` | `boolean` | `false` | ✓ | Adds a small leading mark in the text colour — for status labels repeated down a table column. `icon` wins when both are set |
|
|
52
|
+
| `size` | `'sm'\|'md'` | `'md'` | ✓ | `md` caption text · `sm` overline text with no block padding, for a mark inside a line of text |
|
|
45
53
|
|
|
46
54
|
## CSS Parts
|
|
47
55
|
|
|
@@ -78,4 +86,4 @@ decorative axis carries no meaning, so no icon is drawn there.
|
|
|
78
86
|
| `--tag-color` | Text color |
|
|
79
87
|
| `--tag-bg-color` | Background color |
|
|
80
88
|
| `--tag-border-color` | Border color |
|
|
81
|
-
| `--tag-dot-size` | Diameter of the leading `dot` (default 6px) |
|
|
89
|
+
| `--tag-dot-size` | Diameter of the leading `dot` (default 6px · 5px at `size="sm"`) |
|