@iyulab/components 1.58.0 → 2.0.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 +156 -0
- package/README.md +3 -1
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/light.css.637cb2f8.js +1 -1
- package/dist/assets/locales/ar.json.js +5 -1
- package/dist/assets/locales/de.json.js +5 -1
- package/dist/assets/locales/en.json.js +5 -1
- package/dist/assets/locales/es.json.js +5 -1
- package/dist/assets/locales/fr.json.js +5 -1
- package/dist/assets/locales/id.json.js +5 -1
- package/dist/assets/locales/ja.json.js +5 -1
- package/dist/assets/locales/ko.json.js +5 -1
- package/dist/assets/locales/pt-BR.json.js +5 -1
- package/dist/assets/locales/ru.json.js +5 -1
- package/dist/assets/locales/th.json.js +5 -1
- package/dist/assets/locales/vi.json.js +5 -1
- package/dist/assets/locales/zh-CN.json.js +5 -1
- package/dist/assets/locales/zh-TW.json.js +5 -1
- package/dist/components/UElement.styles.js +2 -2
- package/dist/components/alert/UAlert.d.ts +12 -7
- package/dist/components/alert/UAlert.js +3 -3
- package/dist/components/alert/UAlert.styles.js +6 -23
- package/dist/components/badge/UBadge.d.ts +5 -5
- package/dist/components/badge/UBadge.js +3 -3
- package/dist/components/badge/UBadge.styles.js +4 -4
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +1 -1
- package/dist/components/button/UButton.d.ts +32 -16
- package/dist/components/button/UButton.js +38 -5
- package/dist/components/button/UButton.styles.js +67 -50
- package/dist/components/button/forwarded-aria.d.ts +6 -0
- package/dist/components/button/forwarded-aria.js +15 -0
- package/dist/components/button-group/UButtonGroup.d.ts +4 -4
- package/dist/components/button-group/UButtonGroup.js +8 -8
- package/dist/components/button-group/UButtonGroup.styles.js +2 -2
- package/dist/components/calendar/UCalendar.styles.js +4 -3
- package/dist/components/calendar/picker.styles.js +7 -2
- package/dist/components/card/UCard.d.ts +4 -3
- package/dist/components/card/UCard.js +3 -3
- package/dist/components/card/UCard.styles.js +2 -1
- package/dist/components/carousel/UCarousel.js +2 -2
- package/dist/components/carousel/UCarousel.styles.js +17 -6
- package/dist/components/checkbox/UCheckbox.d.ts +8 -9
- package/dist/components/checkbox/UCheckbox.js +3 -3
- package/dist/components/checkbox/UCheckbox.styles.js +22 -18
- package/dist/components/chip/UChip.d.ts +2 -2
- package/dist/components/chip/UChip.js +4 -4
- package/dist/components/copy-button/UCopyButton.d.ts +2 -2
- package/dist/components/copy-button/UCopyButton.js +4 -4
- package/dist/components/date-picker/UDatePicker.d.ts +3 -0
- package/dist/components/date-picker/UDatePicker.js +8 -3
- package/dist/components/date-picker/UDatePicker.styles.js +13 -2
- package/dist/components/date-range-picker/UDateRangePicker.d.ts +3 -0
- package/dist/components/date-range-picker/UDateRangePicker.js +7 -2
- package/dist/components/date-range-picker/UDateRangePicker.styles.js +13 -3
- package/dist/components/dialog/UDialog.js +1 -1
- package/dist/components/divider/UDivider.d.ts +3 -3
- package/dist/components/divider/UDivider.js +2 -2
- package/dist/components/divider/UDivider.styles.js +5 -5
- package/dist/components/drawer/UDrawer.js +1 -1
- package/dist/components/expander/UExpander.styles.js +2 -2
- package/dist/components/file-input/UFileInput.styles.js +5 -2
- package/dist/components/icon-button/UIconButton.d.ts +4 -3
- package/dist/components/icon-button/UIconButton.js +16 -6
- package/dist/components/icon-button/UIconButton.styles.js +2 -2
- package/dist/components/input/UInput.d.ts +12 -5
- package/dist/components/input/UInput.js +7 -4
- package/dist/components/input/UInput.styles.js +60 -30
- package/dist/components/menu/UMenu.d.ts +5 -4
- package/dist/components/menu/UMenu.js +3 -3
- package/dist/components/menu/UMenu.styles.js +1 -1
- package/dist/components/menu-item/UMenuItem.styles.js +1 -1
- package/dist/components/option/UOption.d.ts +1 -0
- package/dist/components/option/UOption.js +6 -3
- package/dist/components/option/UOption.styles.js +1 -1
- package/dist/components/progress-bar/UProgressBar.styles.js +11 -0
- package/dist/components/radio/URadio.d.ts +27 -6
- package/dist/components/radio/URadio.js +48 -12
- package/dist/components/radio/URadio.styles.js +47 -13
- package/dist/components/rating/URating.styles.js +5 -1
- package/dist/components/select/USelect.d.ts +9 -2
- package/dist/components/select/USelect.js +7 -2
- package/dist/components/select/USelect.styles.js +55 -26
- package/dist/components/slider/USlider.styles.js +4 -4
- package/dist/components/spinner/USpinner.styles.js +2 -0
- package/dist/components/split-panel/USplitPanel.styles.js +2 -1
- package/dist/components/steps/USteps.d.ts +57 -0
- package/dist/components/steps/USteps.js +58 -0
- package/dist/components/steps/USteps.styles.d.ts +1 -0
- package/dist/components/steps/USteps.styles.js +110 -0
- package/dist/components/switch/USwitch.styles.js +5 -3
- package/dist/components/tab/UTab.js +2 -2
- package/dist/components/tab/UTab.styles.js +1 -1
- package/dist/components/tab-panel/UTabPanel.d.ts +11 -2
- package/dist/components/tab-panel/UTabPanel.js +33 -5
- package/dist/components/tab-panel/UTabPanel.styles.js +29 -29
- package/dist/components/tag/UTag.d.ts +14 -6
- package/dist/components/tag/UTag.js +8 -3
- package/dist/components/tag/UTag.styles.js +33 -26
- package/dist/components/textarea/UTextarea.d.ts +9 -3
- package/dist/components/textarea/UTextarea.js +7 -2
- package/dist/components/textarea/UTextarea.styles.js +41 -22
- package/dist/components/tree-item/UTreeItem.styles.js +7 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/plugins/vite-plugin-react-wrapper.js +14 -5
- package/dist/react/UAlert.d.ts +4 -2
- package/dist/react/UAvatar.d.ts +4 -2
- package/dist/react/UBadge.d.ts +4 -2
- package/dist/react/UBreadcrumb.d.ts +4 -2
- package/dist/react/UBreadcrumbItem.d.ts +4 -2
- package/dist/react/UButton.d.ts +4 -2
- package/dist/react/UButtonGroup.d.ts +4 -2
- package/dist/react/UCard.d.ts +4 -2
- package/dist/react/UCarousel.d.ts +4 -2
- package/dist/react/UCheckbox.d.ts +4 -2
- package/dist/react/UChip.d.ts +4 -2
- package/dist/react/UCopyButton.d.ts +4 -2
- package/dist/react/UDatePicker.d.ts +4 -2
- package/dist/react/UDateRangePicker.d.ts +4 -2
- package/dist/react/UDialog.d.ts +4 -2
- package/dist/react/UDivider.d.ts +4 -2
- package/dist/react/UDrawer.d.ts +4 -2
- package/dist/react/UExpander.d.ts +4 -2
- package/dist/react/UField.d.ts +4 -2
- package/dist/react/UFileInput.d.ts +4 -2
- package/dist/react/UForm.d.ts +4 -2
- package/dist/react/UIcon.d.ts +4 -2
- package/dist/react/UIconButton.d.ts +4 -2
- package/dist/react/UInput.d.ts +4 -2
- package/dist/react/UMenu.d.ts +4 -2
- package/dist/react/UMenuItem.d.ts +4 -2
- package/dist/react/UOption.d.ts +4 -2
- package/dist/react/UPanel.d.ts +4 -2
- package/dist/react/UPopover.d.ts +4 -2
- package/dist/react/UProgressBar.d.ts +4 -2
- package/dist/react/UProgressRing.d.ts +4 -2
- package/dist/react/URadio.d.ts +4 -2
- package/dist/react/URating.d.ts +4 -2
- package/dist/react/USelect.d.ts +4 -2
- package/dist/react/USkeleton.d.ts +4 -2
- package/dist/react/USlider.d.ts +4 -2
- package/dist/react/USpinner.d.ts +4 -2
- package/dist/react/USplitPanel.d.ts +4 -2
- package/dist/react/USteps.d.ts +14 -0
- package/dist/react/USteps.js +10 -0
- package/dist/react/USwitch.d.ts +4 -2
- package/dist/react/UTab.d.ts +4 -2
- package/dist/react/UTabPanel.d.ts +4 -2
- package/dist/react/UTag.d.ts +4 -2
- package/dist/react/UText.d.ts +4 -2
- package/dist/react/UTextarea.d.ts +4 -2
- package/dist/react/UTooltip.d.ts +4 -2
- package/dist/react/UTree.d.ts +4 -2
- package/dist/react/UTreeItem.d.ts +4 -2
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/styles/dark.css +42 -0
- package/dist/styles/light.css +44 -0
- package/dist/utilities/Dialog.d.ts +2 -2
- package/dist/utilities/Dialog.js +3 -3
- package/dist/utilities/Locale.d.ts +1 -1
- package/dist/utilities/Toast.d.ts +2 -2
- package/dist/utilities/Toast.js +1 -1
- package/dist/utilities/icons.d.ts +12 -3
- package/dist/utilities/icons.js +24 -6
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +3 -3
- package/skills/iyulab-components/references/components/alert.md +5 -5
- package/skills/iyulab-components/references/components/badge.md +3 -3
- package/skills/iyulab-components/references/components/button-group.md +3 -3
- package/skills/iyulab-components/references/components/button.md +34 -19
- package/skills/iyulab-components/references/components/card.md +3 -3
- package/skills/iyulab-components/references/components/checkbox.md +5 -5
- package/skills/iyulab-components/references/components/chip.md +2 -2
- package/skills/iyulab-components/references/components/copy-button.md +1 -1
- package/skills/iyulab-components/references/components/date-picker.md +1 -0
- package/skills/iyulab-components/references/components/date-range-picker.md +1 -0
- package/skills/iyulab-components/references/components/dialog.md +2 -2
- package/skills/iyulab-components/references/components/divider.md +2 -2
- package/skills/iyulab-components/references/components/drawer.md +1 -1
- package/skills/iyulab-components/references/components/field.md +1 -1
- package/skills/iyulab-components/references/components/icon-button.md +8 -2
- package/skills/iyulab-components/references/components/input.md +4 -2
- package/skills/iyulab-components/references/components/menu.md +1 -1
- package/skills/iyulab-components/references/components/radio.md +16 -4
- package/skills/iyulab-components/references/components/select.md +2 -1
- package/skills/iyulab-components/references/components/steps.md +66 -0
- package/skills/iyulab-components/references/components/tab-panel.md +10 -3
- package/skills/iyulab-components/references/components/tag.md +11 -7
- package/skills/iyulab-components/references/components/textarea.md +2 -1
- package/skills/iyulab-components/references/usage.md +1 -1
- package/skills/iyulab-components/references/utilities/dialog.md +2 -2
- package/skills/iyulab-components/references/utilities/icons.md +2 -2
- package/skills/iyulab-components/references/utilities/theme.md +9 -5
- package/skills/iyulab-components/references/utilities/toast.md +2 -2
|
@@ -7,11 +7,13 @@ import { styles } from "./UTabPanel.styles.js";
|
|
|
7
7
|
import { html } from "lit";
|
|
8
8
|
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/tab-panel/UTabPanel.ts
|
|
10
|
+
var idSeq = 0;
|
|
11
|
+
var nextId = (prefix) => `${prefix}-${++idSeq}`;
|
|
10
12
|
var UTabPanel = class UTabPanel extends UElement {
|
|
11
13
|
constructor(..._args) {
|
|
12
14
|
super(..._args);
|
|
13
15
|
this.disabled = false;
|
|
14
|
-
this.
|
|
16
|
+
this.appearance = "line";
|
|
15
17
|
this.placement = "top";
|
|
16
18
|
this.value = "";
|
|
17
19
|
this.draggable = false;
|
|
@@ -74,9 +76,11 @@ var UTabPanel = class UTabPanel extends UElement {
|
|
|
74
76
|
this.handleNavWheel = (e) => {
|
|
75
77
|
if (!this.isVertical) {
|
|
76
78
|
e.preventDefault();
|
|
77
|
-
e.currentTarget
|
|
79
|
+
const target = e.currentTarget;
|
|
80
|
+
const reduce = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
81
|
+
target.scrollBy({
|
|
78
82
|
left: e.deltaY,
|
|
79
|
-
behavior: "smooth"
|
|
83
|
+
behavior: reduce ? "auto" : "smooth"
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
86
|
};
|
|
@@ -118,12 +122,36 @@ var UTabPanel = class UTabPanel extends UElement {
|
|
|
118
122
|
composed: false
|
|
119
123
|
});
|
|
120
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* 선택 상태를 외형(`active`)과 보조기기 표면에 함께 싣는다 — WAI-ARIA APG Tabs.
|
|
127
|
+
* - 탭: `aria-selected` · 로빙 tabindex(선택된 탭만 0 — Tab 은 탭 목록에 한 번만 멈추고,
|
|
128
|
+
* 안에서는 화살표가 옮긴다). 선택된 탭이 없거나 비활성이면 첫 활성 탭이 0 을 받는다.
|
|
129
|
+
* - 패널: `role="tabpanel"` · 같은 `value` 의 탭과 `aria-controls`/`aria-labelledby` 로 잇는다.
|
|
130
|
+
* 탭과 패널은 같은 light DOM 에 있으므로 id 참조가 성립한다. 소비자는 id 를 몰라도 된다 —
|
|
131
|
+
* 없으면 만든다(주어진 id 는 그대로 쓴다).
|
|
132
|
+
*/
|
|
121
133
|
updateTabPanel() {
|
|
134
|
+
const stop = this.tabs.find((t) => t.value === this.value && !t.disabled) ?? this.tabs.find((t) => !t.disabled);
|
|
135
|
+
const panelOf = new Map(this.panels.map((p) => [p.value, p]));
|
|
136
|
+
const tabOf = new Map(this.tabs.map((t) => [t.value, t]));
|
|
122
137
|
this.tabs.forEach((tab) => {
|
|
123
|
-
|
|
138
|
+
const selected = tab.value === this.value;
|
|
139
|
+
tab.toggleAttribute("active", selected);
|
|
140
|
+
tab.setAttribute("aria-selected", String(selected));
|
|
141
|
+
tab.setAttribute("tabindex", tab === stop ? "0" : "-1");
|
|
142
|
+
if (!tab.id) tab.id = nextId("u-tab");
|
|
143
|
+
const panel = panelOf.get(tab.value);
|
|
144
|
+
if (panel) {
|
|
145
|
+
if (!panel.id) panel.id = nextId("u-tab-panel");
|
|
146
|
+
tab.setAttribute("aria-controls", panel.id);
|
|
147
|
+
} else tab.removeAttribute("aria-controls");
|
|
124
148
|
});
|
|
125
149
|
this.panels.forEach((panel) => {
|
|
126
150
|
panel.hidden = panel.value !== this.value;
|
|
151
|
+
panel.setAttribute("role", "tabpanel");
|
|
152
|
+
const tab = tabOf.get(panel.value);
|
|
153
|
+
if (tab) panel.setAttribute("aria-labelledby", tab.id);
|
|
154
|
+
else panel.removeAttribute("aria-labelledby");
|
|
127
155
|
});
|
|
128
156
|
}
|
|
129
157
|
};
|
|
@@ -134,7 +162,7 @@ __decorate([property({
|
|
|
134
162
|
__decorate([property({
|
|
135
163
|
type: String,
|
|
136
164
|
reflect: true
|
|
137
|
-
}), __decorateMetadata("design:type", Object)], UTabPanel.prototype, "
|
|
165
|
+
}), __decorateMetadata("design:type", Object)], UTabPanel.prototype, "appearance", void 0);
|
|
138
166
|
__decorate([property({
|
|
139
167
|
type: String,
|
|
140
168
|
reflect: true
|
|
@@ -79,124 +79,124 @@ var styles = css`
|
|
|
79
79
|
overflow: auto;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/*
|
|
82
|
+
/* Appearance: line */
|
|
83
83
|
|
|
84
|
-
:host([
|
|
84
|
+
:host([appearance="line"]) ::slotted(u-tab[active]) {
|
|
85
85
|
position: relative;
|
|
86
86
|
color: var(--tab-panel-color);
|
|
87
87
|
}
|
|
88
|
-
:host([
|
|
88
|
+
:host([appearance="line"]) ::slotted(u-tab[active])::after {
|
|
89
89
|
content: '';
|
|
90
90
|
position: absolute;
|
|
91
91
|
background-color: var(--tab-panel-color);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
:host([
|
|
94
|
+
:host([appearance="line"][placement="top"]) .header {
|
|
95
95
|
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
96
96
|
}
|
|
97
|
-
:host([
|
|
97
|
+
:host([appearance="line"][placement="top"]) ::slotted(u-tab[active])::after {
|
|
98
98
|
height: 2px;
|
|
99
99
|
bottom: 0;
|
|
100
100
|
left: 0;
|
|
101
101
|
right: 0;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
:host([
|
|
104
|
+
:host([appearance="line"][placement="bottom"]) .header {
|
|
105
105
|
border-top: 1px solid var(--u-border-color, #E0E0E0);
|
|
106
106
|
}
|
|
107
|
-
:host([
|
|
107
|
+
:host([appearance="line"][placement="bottom"]) ::slotted(u-tab[active])::after {
|
|
108
108
|
height: 2px;
|
|
109
109
|
top: 0;
|
|
110
110
|
left: 0;
|
|
111
111
|
right: 0;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
:host([
|
|
114
|
+
:host([appearance="line"][placement="left"]) .header {
|
|
115
115
|
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
116
116
|
}
|
|
117
|
-
:host([
|
|
117
|
+
:host([appearance="line"][placement="left"]) ::slotted(u-tab[active])::after {
|
|
118
118
|
width: 2px;
|
|
119
119
|
right: 0;
|
|
120
120
|
top: 0;
|
|
121
121
|
bottom: 0;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
:host([
|
|
124
|
+
:host([appearance="line"][placement="right"]) .header {
|
|
125
125
|
border-left: 1px solid var(--u-border-color, #E0E0E0);
|
|
126
126
|
}
|
|
127
|
-
:host([
|
|
127
|
+
:host([appearance="line"][placement="right"]) ::slotted(u-tab[active])::after {
|
|
128
128
|
width: 2px;
|
|
129
129
|
left: 0;
|
|
130
130
|
top: 0;
|
|
131
131
|
bottom: 0;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/*
|
|
134
|
+
/* Appearance: card */
|
|
135
135
|
|
|
136
|
-
:host([
|
|
136
|
+
:host([appearance="card"]) ::slotted(u-tab) {
|
|
137
137
|
background-color: var(--u-neutral-100, #F5F5F5);
|
|
138
138
|
}
|
|
139
|
-
:host([
|
|
139
|
+
:host([appearance="card"]) ::slotted(u-tab[active]) {
|
|
140
140
|
color: var(--u-txt-color, #212121);
|
|
141
141
|
background-color: var(--u-neutral-0, #FFFFFF);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
:host([
|
|
144
|
+
:host([appearance="card"][placement="top"]) ::slotted(u-tab) {
|
|
145
145
|
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
146
146
|
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
147
147
|
}
|
|
148
|
-
:host([
|
|
148
|
+
:host([appearance="card"][placement="top"]) ::slotted(u-tab[active]) {
|
|
149
149
|
border-bottom: none;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
:host([
|
|
152
|
+
:host([appearance="card"][placement="bottom"]) ::slotted(u-tab) {
|
|
153
153
|
border-top: 1px solid var(--u-border-color, #E0E0E0);
|
|
154
154
|
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
155
155
|
}
|
|
156
|
-
:host([
|
|
156
|
+
:host([appearance="card"][placement="bottom"]) ::slotted(u-tab[active]) {
|
|
157
157
|
border-top: none;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
:host([
|
|
160
|
+
:host([appearance="card"][placement="left"]) ::slotted(u-tab) {
|
|
161
161
|
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
162
162
|
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
163
163
|
}
|
|
164
|
-
:host([
|
|
164
|
+
:host([appearance="card"][placement="left"]) ::slotted(u-tab[active]) {
|
|
165
165
|
border-right: none;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
:host([
|
|
168
|
+
:host([appearance="card"][placement="right"]) ::slotted(u-tab) {
|
|
169
169
|
border-left: 1px solid var(--u-border-color, #E0E0E0);
|
|
170
170
|
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
171
171
|
}
|
|
172
|
-
:host([
|
|
172
|
+
:host([appearance="card"][placement="right"]) ::slotted(u-tab[active]) {
|
|
173
173
|
border-left: none;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/*
|
|
176
|
+
/* Appearance: pill */
|
|
177
177
|
|
|
178
|
-
:host([
|
|
178
|
+
:host([appearance="pill"]) .nav {
|
|
179
179
|
gap: 0.25em;
|
|
180
180
|
padding: 0.25em;
|
|
181
181
|
background-color: var(--u-neutral-100, #F5F5F5);
|
|
182
182
|
border-radius: var(--u-radius-xl, 8px);
|
|
183
183
|
}
|
|
184
|
-
:host([
|
|
184
|
+
:host([appearance="pill"]) ::slotted(u-tab) {
|
|
185
185
|
border: 1px solid transparent;
|
|
186
186
|
border-radius: var(--u-radius-lg, 6px);
|
|
187
187
|
}
|
|
188
|
-
:host([
|
|
188
|
+
:host([appearance="pill"]) ::slotted(u-tab[active]) {
|
|
189
189
|
border-color: var(--u-border-color, #E0E0E0);
|
|
190
190
|
background-color: var(--u-neutral-0, #FFFFFF);
|
|
191
191
|
box-shadow: var(--u-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04));
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
/*
|
|
194
|
+
/* Appearance: plain */
|
|
195
195
|
|
|
196
|
-
:host([
|
|
196
|
+
:host([appearance="plain"]) .nav {
|
|
197
197
|
gap: 0.25em;
|
|
198
198
|
}
|
|
199
|
-
:host([
|
|
199
|
+
:host([appearance="plain"]) ::slotted(u-tab[active]) {
|
|
200
200
|
color: var(--tab-panel-color);
|
|
201
201
|
font-weight: 600;
|
|
202
202
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { UElement } from '../UElement.js';
|
|
2
|
-
|
|
2
|
+
/** 외형 정도 — `solid` 꽉 찬 면 · `soft` 옅은 틴트(기본) · `outlined` 테두리 · `plain` 글자만. */
|
|
3
|
+
export type TagAppearance = "solid" | "soft" | "outlined" | "plain";
|
|
3
4
|
/**
|
|
4
5
|
* 두 축이 병존한다 — **역할 축**(`primary`·`info`·`success`·`warning`·`danger`)은 *의미*를
|
|
5
6
|
* 말하고 리브랜딩을 따라오며 대비 계약을 물려받는다. **장식 축**(`blue`·`purple` …)은
|
|
6
|
-
* *색 자체*를 말하고 리브랜딩에 의도적으로 면역이다.
|
|
7
|
+
* *색 자체*를 말하고 리브랜딩에 의도적으로 면역이다. `neutral`(기본)은 **무채색**이다.
|
|
7
8
|
*/
|
|
8
|
-
export type TagColor = "neutral" | "primary" | "info" | "success" | "warning" | "danger" | "blue" | "green" | "yellow" | "red" | "orange" | "teal" | "cyan" | "purple" | "pink"
|
|
9
|
+
export type TagColor = "neutral" | "primary" | "info" | "success" | "warning" | "danger" | "blue" | "green" | "yellow" | "red" | "orange" | "teal" | "cyan" | "purple" | "pink";
|
|
9
10
|
/**
|
|
10
11
|
* 레이블, 카테고리, 상태 등을 표시하는 태그 컴포넌트입니다.
|
|
11
12
|
*
|
|
@@ -16,19 +17,20 @@ export type TagColor = "neutral" | "primary" | "info" | "success" | "warning" |
|
|
|
16
17
|
* @csspart base - 태그 바깥 상자
|
|
17
18
|
* @csspart content - 콘텐츠 영역
|
|
18
19
|
* @csspart icon - 상태 아이콘 (`icon` + 역할 색일 때만 렌더된다)
|
|
20
|
+
* @csspart dot - 앞머리 점 (`dot` 일 때만 렌더된다)
|
|
19
21
|
*
|
|
20
22
|
* @cssprop --tag-color - 텍스트 색상
|
|
21
23
|
* @cssprop --tag-bg-color - 배경 색상
|
|
22
24
|
* @cssprop --tag-border-color - 테두리 색상
|
|
23
|
-
* @cssprop --tag-fill-color - variant 별 채움 기준색 (기본: --u-primary-color)
|
|
24
25
|
* @cssprop --tag-padding-block - 세로 여백
|
|
25
26
|
* @cssprop --tag-padding-inline - 가로 여백
|
|
26
27
|
* @cssprop --tag-gap - prefix/본문/suffix 사이 간격
|
|
28
|
+
* @cssprop --tag-dot-size - 앞머리 점의 지름 (기본 6px)
|
|
27
29
|
*/
|
|
28
30
|
export declare class UTag extends UElement {
|
|
29
31
|
static styles: import('lit').CSSResultGroup[];
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
+
/** 외형 정도 */
|
|
33
|
+
appearance: TagAppearance;
|
|
32
34
|
/** 태그의 색상을 설정합니다. */
|
|
33
35
|
color: TagColor;
|
|
34
36
|
/** 태그를 둥글게 표시합니다. */
|
|
@@ -39,6 +41,12 @@ export declare class UTag extends UElement {
|
|
|
39
41
|
* 의미가 없는 색(`neutral`·`primary`·장식 축)에서는 아무것도 그리지 않습니다.
|
|
40
42
|
*/
|
|
41
43
|
icon: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 글자 앞에 글자색의 작은 점을 찍습니다 — 표 안의 상태 배지처럼 **같은 열에서 색이 줄지어 반복될 때**
|
|
46
|
+
* 색이 아니라 모양으로도 «이것은 상태다» 를 표시하는 보조 표식입니다. 상태의 뜻은 여전히 글자가 말합니다.
|
|
47
|
+
* `icon` 과 함께 켜면 아이콘이 우선합니다(둘 다 그리지 않습니다).
|
|
48
|
+
*/
|
|
49
|
+
dot: boolean;
|
|
42
50
|
render(): import('lit-html').TemplateResult<1>;
|
|
43
51
|
}
|
|
44
52
|
declare global {
|
|
@@ -10,10 +10,11 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
10
10
|
var UTag = class UTag extends UElement {
|
|
11
11
|
constructor(..._args) {
|
|
12
12
|
super(..._args);
|
|
13
|
-
this.
|
|
13
|
+
this.appearance = "soft";
|
|
14
14
|
this.color = "neutral";
|
|
15
15
|
this.rounded = false;
|
|
16
16
|
this.icon = false;
|
|
17
|
+
this.dot = false;
|
|
17
18
|
}
|
|
18
19
|
static {
|
|
19
20
|
this.styles = [super.styles, styles];
|
|
@@ -22,7 +23,7 @@ var UTag = class UTag extends UElement {
|
|
|
22
23
|
const iconName = this.icon ? statusIcon(this.color) : void 0;
|
|
23
24
|
return html`
|
|
24
25
|
<div class="base" part="base">
|
|
25
|
-
${iconName ? html`<u-icon class="icon" part="icon" lib="internal" name=${iconName}></u-icon>` : nothing}
|
|
26
|
+
${iconName ? html`<u-icon class="icon" part="icon" lib="internal" name=${iconName}></u-icon>` : this.dot ? html`<span class="dot" part="dot" aria-hidden="true"></span>` : nothing}
|
|
26
27
|
<slot name="prefix"></slot>
|
|
27
28
|
<span class="content" part="content">
|
|
28
29
|
<slot></slot>
|
|
@@ -35,7 +36,7 @@ var UTag = class UTag extends UElement {
|
|
|
35
36
|
__decorate([property({
|
|
36
37
|
type: String,
|
|
37
38
|
reflect: true
|
|
38
|
-
}), __decorateMetadata("design:type", Object)], UTag.prototype, "
|
|
39
|
+
}), __decorateMetadata("design:type", Object)], UTag.prototype, "appearance", void 0);
|
|
39
40
|
__decorate([property({
|
|
40
41
|
type: String,
|
|
41
42
|
reflect: true
|
|
@@ -48,6 +49,10 @@ __decorate([property({
|
|
|
48
49
|
type: Boolean,
|
|
49
50
|
reflect: true
|
|
50
51
|
}), __decorateMetadata("design:type", Object)], UTag.prototype, "icon", void 0);
|
|
52
|
+
__decorate([property({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: true
|
|
55
|
+
}), __decorateMetadata("design:type", Object)], UTag.prototype, "dot", void 0);
|
|
51
56
|
UTag = __decorate([customElement("u-tag")], UTag);
|
|
52
57
|
//#endregion
|
|
53
58
|
export { UTag };
|
|
@@ -2,7 +2,6 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/tag/UTag.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
-
--tag-fill-color: var(--u-primary-color, #1976D2);
|
|
6
5
|
--tag-color: var(--u-neutral-800, #424242);
|
|
7
6
|
--tag-bg-color: var(--u-neutral-100, #F5F5F5);
|
|
8
7
|
--tag-border-color: transparent;
|
|
@@ -15,7 +14,7 @@ var styles = css`
|
|
|
15
14
|
|
|
16
15
|
슬롯이 여섯인 이유는 자리마다 대비 요구가 다르기 때문이다(실측, 두 테마 전건 AA):
|
|
17
16
|
solid 면 --u-{role}-color + 그 위 글자 --u-{role}-txt-color (4.60~15.05)
|
|
18
|
-
|
|
17
|
+
soft 연한 면 --u-{role}-bg-color + 그 위 글자 --u-{role}-color-strong (4.58~7.00)
|
|
19
18
|
outlined 바탕 위 글자 --u-{role}-color-strong (계약 검사 대상)
|
|
20
19
|
========================================================================== */
|
|
21
20
|
:host([color="primary"]) {
|
|
@@ -63,13 +62,12 @@ var styles = css`
|
|
|
63
62
|
장식 축 — 색 슬롯 매핑
|
|
64
63
|
color="purple" 에는 역할 의미가 없다(장식이다). 그래서 역할 토큰이 아니라
|
|
65
64
|
팔레트를 직접 읽으며, 브랜드 오버라이드에 의도적으로 면역이다.
|
|
66
|
-
아래
|
|
67
|
-
슬롯이 비면(color="neutral") variant 규칙의 폴백 = 브랜드 경로를 탄다.
|
|
65
|
+
아래 규칙이 hue 슬롯을 채우고, appearance 규칙이 그것을 소비한다.
|
|
68
66
|
========================================================================== */
|
|
69
|
-
/*
|
|
70
|
-
|
|
71
|
-
한 단 진하게 쓴다: solid 면은 흰 글자 대비로 700, 연한 면은 흰 바탕·올림면과 구별되게 200. */
|
|
72
|
-
:host([color="
|
|
67
|
+
/* neutral — 무채색(기본). 2.0 전에는 neutral 이 «브랜드 경로»였고 회색 레이블은 장식 축 gray 로만
|
|
68
|
+
낼 수 있었다 — 같은 낱말이 배지·체크박스에서는 회색이라 뜻이 정반대였다. 중립 램프를 읽되 명도 때문에
|
|
69
|
+
두 자리를 한 단 진하게 쓴다: solid 면은 흰 글자 대비로 700, 연한 면은 흰 바탕·올림면과 구별되게 200. */
|
|
70
|
+
:host([color="neutral"]) {
|
|
73
71
|
--tag-hue-solid: var(--u-neutral-700, #616161);
|
|
74
72
|
--tag-hue-line: var(--u-neutral-300, #E0E0E0);
|
|
75
73
|
--tag-hue-surface: var(--u-neutral-200, #EEEEEE);
|
|
@@ -141,34 +139,34 @@ var styles = css`
|
|
|
141
139
|
--tag-hue-text-outlined: var(--u-pink-600, #D81B60);
|
|
142
140
|
}
|
|
143
141
|
|
|
144
|
-
/*
|
|
145
|
-
:host([
|
|
142
|
+
/* solid — 강한 채움 */
|
|
143
|
+
:host([appearance="solid"]) {
|
|
146
144
|
/* 면 위의 글자. 장식 축은 슬롯이 비어 흰색으로 떨어진다(현행 보존) — 역할 축에서만
|
|
147
145
|
갈린다. warning 이 그 이유다: 노란 면 위의 흰 글자는 읽히지 않는다. */
|
|
148
146
|
--tag-color: var(--tag-hue-on-solid, var(--u-neutral-0, #FFFFFF));
|
|
149
|
-
--tag-bg-color: var(--tag-hue-solid
|
|
150
|
-
--tag-border-color: var(--tag-hue-solid
|
|
147
|
+
--tag-bg-color: var(--tag-hue-solid);
|
|
148
|
+
--tag-border-color: var(--tag-hue-solid);
|
|
151
149
|
}
|
|
152
150
|
|
|
153
|
-
/*
|
|
154
|
-
:host([
|
|
155
|
-
--tag-color: var(--tag-hue-text
|
|
156
|
-
--tag-bg-color: var(--tag-hue-surface
|
|
157
|
-
--tag-border-color:
|
|
151
|
+
/* soft — 옅은 틴트, 테두리 없음 (기본) */
|
|
152
|
+
:host([appearance="soft"]) {
|
|
153
|
+
--tag-color: var(--tag-hue-text);
|
|
154
|
+
--tag-bg-color: var(--tag-hue-surface);
|
|
155
|
+
--tag-border-color: transparent;
|
|
158
156
|
}
|
|
159
157
|
|
|
160
|
-
/*
|
|
161
|
-
:host([
|
|
162
|
-
--tag-color: var(--tag-hue-text
|
|
163
|
-
--tag-bg-color:
|
|
164
|
-
--tag-border-color:
|
|
158
|
+
/* outlined — 테두리만 */
|
|
159
|
+
:host([appearance="outlined"]) {
|
|
160
|
+
--tag-color: var(--tag-hue-text-outlined);
|
|
161
|
+
--tag-bg-color: transparent;
|
|
162
|
+
--tag-border-color: var(--tag-hue-line);
|
|
165
163
|
}
|
|
166
164
|
|
|
167
|
-
/*
|
|
168
|
-
:host([
|
|
169
|
-
--tag-color: var(--tag-hue-text-outlined
|
|
165
|
+
/* plain — 외형 없음: 색 글자만 */
|
|
166
|
+
:host([appearance="plain"]) {
|
|
167
|
+
--tag-color: var(--tag-hue-text-outlined);
|
|
170
168
|
--tag-bg-color: transparent;
|
|
171
|
-
--tag-border-color:
|
|
169
|
+
--tag-border-color: transparent;
|
|
172
170
|
}
|
|
173
171
|
|
|
174
172
|
:host {
|
|
@@ -223,6 +221,15 @@ var styles = css`
|
|
|
223
221
|
overflow: hidden;
|
|
224
222
|
text-overflow: ellipsis;
|
|
225
223
|
}
|
|
224
|
+
|
|
225
|
+
/* 앞머리 점 — 글자색을 따른다(역할·장식 축 어느 쪽이든 글자와 같은 색). */
|
|
226
|
+
.dot {
|
|
227
|
+
flex: none;
|
|
228
|
+
width: var(--tag-dot-size, 6px);
|
|
229
|
+
height: var(--tag-dot-size, 6px);
|
|
230
|
+
border-radius: var(--u-radius-circle, 50%);
|
|
231
|
+
background: currentColor;
|
|
232
|
+
}
|
|
226
233
|
`;
|
|
227
234
|
//#endregion
|
|
228
235
|
export { styles };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
|
+
import { FieldAppearance, FieldSize, AutoCapitalize, EnterKeyHint, InputModeOption } from '../input/UInput.js';
|
|
2
3
|
import { UFormControlElement } from '../UFormControlElement.js';
|
|
3
|
-
import { AutoCapitalize, EnterKeyHint, InputModeOption } from '../input/UInput.js';
|
|
4
|
-
type TextareaVariant = 'outlined' | 'filled' | 'underlined' | 'borderless';
|
|
5
4
|
type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both' | 'auto';
|
|
6
5
|
/**
|
|
7
6
|
* 여러 줄의 텍스트 입력을 지원하는 텍스트에어리어 컴포넌트입니다.
|
|
@@ -22,7 +21,14 @@ type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both' | 'auto';
|
|
|
22
21
|
export declare class UTextarea extends UFormControlElement<string> {
|
|
23
22
|
static styles: import('lit').CSSResultGroup[];
|
|
24
23
|
/** 스타일 변형 */
|
|
25
|
-
|
|
24
|
+
/** 외형 정도 */
|
|
25
|
+
appearance: FieldAppearance;
|
|
26
|
+
/**
|
|
27
|
+
* 크기 — 버튼의 `size` 와 같은 세 단(`sm` 12px · `md` 기본 = `--u-density`(14px) · `lg` 16px).
|
|
28
|
+
* 상자 높이는 글자 크기에서 파생된다(1.5em 줄 + 필드 상자 여백 × 2 + 테두리) — 같은 `size` 의 버튼과
|
|
29
|
+
* 한 줄에 서도록. 테마는 필드 상자 토큰(`--u-field-padding-block`)으로 단마다 높이를 다듬는다.
|
|
30
|
+
*/
|
|
31
|
+
size: FieldSize;
|
|
26
32
|
/** 리사이즈 모드 */
|
|
27
33
|
resize: TextareaResize;
|
|
28
34
|
/** 최소 행 수 */
|
|
@@ -12,7 +12,8 @@ import { live } from "lit/directives/live.js";
|
|
|
12
12
|
var UTextarea = class UTextarea extends UFormControlElement {
|
|
13
13
|
constructor(..._args) {
|
|
14
14
|
super(..._args);
|
|
15
|
-
this.
|
|
15
|
+
this.appearance = "outlined";
|
|
16
|
+
this.size = "md";
|
|
16
17
|
this.resize = "auto";
|
|
17
18
|
this.counter = false;
|
|
18
19
|
this.spellcheck = false;
|
|
@@ -132,7 +133,11 @@ var UTextarea = class UTextarea extends UFormControlElement {
|
|
|
132
133
|
__decorate([property({
|
|
133
134
|
type: String,
|
|
134
135
|
reflect: true
|
|
135
|
-
}), __decorateMetadata("design:type", Object)], UTextarea.prototype, "
|
|
136
|
+
}), __decorateMetadata("design:type", Object)], UTextarea.prototype, "appearance", void 0);
|
|
137
|
+
__decorate([property({
|
|
138
|
+
type: String,
|
|
139
|
+
reflect: true
|
|
140
|
+
}), __decorateMetadata("design:type", Object)], UTextarea.prototype, "size", void 0);
|
|
136
141
|
__decorate([property({
|
|
137
142
|
type: String,
|
|
138
143
|
reflect: true
|
|
@@ -7,16 +7,18 @@ var styles = css`
|
|
|
7
7
|
display: var(--u-textarea-display, inline-block);
|
|
8
8
|
width: var(--u-textarea-width, auto);
|
|
9
9
|
color: var(--u-txt-color, #212121);
|
|
10
|
-
font-size: inherit;
|
|
11
10
|
font-family: var(--u-font-base);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
/* ===== 컨테이너 (outlined 기본) ===== */
|
|
15
14
|
.container {
|
|
16
15
|
display: flex;
|
|
17
|
-
padding: 0.3em 0.6em;
|
|
16
|
+
padding: var(--u-field-padding-block, 0.3em) var(--u-field-padding-inline, 0.6em);
|
|
17
|
+
/* 호스트 하한(--u-target-size, 미설정 = 0) — 글자와 독립된 터치 하한. */
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
min-height: var(--u-target-size, 0px);
|
|
18
20
|
border: 1px solid var(--u-input-border-color, #E0E0E0);
|
|
19
|
-
border-radius: 0.25em;
|
|
21
|
+
border-radius: var(--u-field-radius, 0.25em);
|
|
20
22
|
background-color: var(--u-input-bg-color, #FFFFFF);
|
|
21
23
|
transition: border-color var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)), box-shadow var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)), background-color var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
22
24
|
}
|
|
@@ -35,34 +37,34 @@ var styles = css`
|
|
|
35
37
|
box-shadow: 0 0 0 1px var(--u-input-border-color-invalid, #C62828);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
/* =====
|
|
39
|
-
:host([
|
|
40
|
+
/* ===== Appearance: soft (중립 틴트 면) ===== */
|
|
41
|
+
:host([appearance="soft"]) .container {
|
|
40
42
|
border-color: transparent;
|
|
41
43
|
background-color: var(--u-neutral-200, #EEEEEE);
|
|
42
|
-
border-radius: 0.25em 0.25em 0 0;
|
|
44
|
+
border-radius: var(--u-field-radius, 0.25em) var(--u-field-radius, 0.25em) 0 0;
|
|
43
45
|
border-bottom: 2px solid var(--u-input-border-color, #E0E0E0);
|
|
44
46
|
}
|
|
45
|
-
:host([
|
|
46
|
-
:host([
|
|
47
|
+
:host([appearance="soft"][readonly]) .container,
|
|
48
|
+
:host([appearance="soft"]:disabled) .container {
|
|
47
49
|
background-color: var(--u-bg-color-disabled, #FAFAFA);
|
|
48
50
|
border-bottom-color: var(--u-border-color-weak, #EEEEEE);
|
|
49
51
|
}
|
|
50
|
-
:host([
|
|
52
|
+
:host([appearance="soft"]:not([readonly]):not(:disabled)) .container:hover {
|
|
51
53
|
box-shadow: none;
|
|
52
54
|
background-color: var(--u-neutral-300, #E0E0E0);
|
|
53
55
|
border-bottom-color: var(--u-input-border-color-hover, #BDBDBD);
|
|
54
56
|
}
|
|
55
|
-
:host([
|
|
57
|
+
:host([appearance="soft"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
56
58
|
box-shadow: none;
|
|
57
59
|
border-bottom-color: var(--u-input-border-color-focus, #1565C0);
|
|
58
60
|
}
|
|
59
|
-
:host([
|
|
61
|
+
:host([appearance="soft"][invalid]:not([readonly]):not(:disabled)) .container {
|
|
60
62
|
box-shadow: none;
|
|
61
63
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
/* =====
|
|
65
|
-
:host([
|
|
66
|
+
/* ===== Appearance: underlined ===== */
|
|
67
|
+
:host([appearance="underlined"]) .container {
|
|
66
68
|
border: none;
|
|
67
69
|
border-radius: var(--u-radius-none, 0);
|
|
68
70
|
background-color: transparent;
|
|
@@ -70,37 +72,43 @@ var styles = css`
|
|
|
70
72
|
padding-right: 0;
|
|
71
73
|
border-bottom: 1px solid var(--u-input-border-color, #E0E0E0);
|
|
72
74
|
}
|
|
73
|
-
:host([
|
|
74
|
-
:host([
|
|
75
|
+
:host([appearance="underlined"][readonly]) .container,
|
|
76
|
+
:host([appearance="underlined"]:disabled) .container {
|
|
75
77
|
background-color: transparent;
|
|
76
78
|
border-bottom-color: var(--u-border-color-weak, #EEEEEE);
|
|
77
79
|
}
|
|
78
|
-
:host([
|
|
80
|
+
:host([appearance="underlined"]:not([readonly]):not(:disabled)) .container:hover {
|
|
79
81
|
box-shadow: none;
|
|
80
82
|
border-bottom-color: var(--u-input-border-color-hover, #BDBDBD);
|
|
81
83
|
}
|
|
82
|
-
:host([
|
|
84
|
+
:host([appearance="underlined"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
83
85
|
box-shadow: none;
|
|
84
86
|
border-bottom-color: var(--u-input-border-color-focus, #1565C0);
|
|
85
87
|
border-bottom-width: 2px;
|
|
86
88
|
}
|
|
87
|
-
:host([
|
|
89
|
+
:host([appearance="underlined"][invalid]:not([readonly]):not(:disabled)) .container {
|
|
88
90
|
box-shadow: none;
|
|
89
91
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
/* =====
|
|
93
|
-
:host([
|
|
94
|
+
/* ===== Appearance: plain (외형 없음) ===== */
|
|
95
|
+
:host([appearance="plain"]) .container {
|
|
94
96
|
border: none;
|
|
95
97
|
border-radius: var(--u-radius-none, 0);
|
|
96
98
|
background-color: transparent;
|
|
97
99
|
padding: 0;
|
|
98
100
|
box-shadow: none;
|
|
99
101
|
}
|
|
100
|
-
:host([
|
|
101
|
-
:host([
|
|
102
|
+
:host([appearance="plain"]:not([readonly]):not(:disabled)) .container:hover,
|
|
103
|
+
:host([appearance="plain"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
102
104
|
box-shadow: none;
|
|
103
105
|
}
|
|
106
|
+
/* 외형이 없어도 포커스는 보여야 한다(WCAG 2.4.7) — 쉬는 동안은 아무것도 그리지 않고, 포커스가
|
|
107
|
+
들어오면 링을 그린다. 깜박이는 캐럿만으로는 «어디에 포커스가 있는가» 를 알리기 어렵다. */
|
|
108
|
+
:host([appearance="plain"]:not(:disabled)) .container:focus-within {
|
|
109
|
+
outline: 2px solid var(--u-focus-ring-color, #1565C0);
|
|
110
|
+
outline-offset: 2px;
|
|
111
|
+
}
|
|
104
112
|
|
|
105
113
|
/* ===== Textarea 요소 ===== */
|
|
106
114
|
textarea {
|
|
@@ -162,6 +170,17 @@ var styles = css`
|
|
|
162
170
|
font-size: 0.75em;
|
|
163
171
|
line-height: 1.2;
|
|
164
172
|
}
|
|
173
|
+
|
|
174
|
+
/* === Size — 버튼과 같은 세 단. md 는 주변 글자 크기를 상속하지 않는다(버튼과 높이가 갈렸다). === */
|
|
175
|
+
:host {
|
|
176
|
+
font-size: var(--u-density, 14px);
|
|
177
|
+
}
|
|
178
|
+
:host([size="sm"]) {
|
|
179
|
+
font-size: 12px;
|
|
180
|
+
}
|
|
181
|
+
:host([size="lg"]) {
|
|
182
|
+
font-size: 16px;
|
|
183
|
+
}
|
|
165
184
|
`;
|
|
166
185
|
//#endregion
|
|
167
186
|
export { styles };
|
|
@@ -26,7 +26,7 @@ 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
|
+
);\n /* 호스트 하한(--u-target-size, 미설정 = 0). */\n box-sizing: border-box;\n min-height: var(--u-target-size, 0px);
|
|
30
30
|
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
31
|
user-select: none;
|
|
32
32
|
cursor: pointer;
|
|
@@ -72,8 +72,9 @@ var styles = css`
|
|
|
72
72
|
display: inline-flex;
|
|
73
73
|
align-items: center;
|
|
74
74
|
justify-content: center;
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
/* 호스트 하한(--u-target-size)이 있으면 그 값 — 미설정이면 24px 그대로. */
|
|
76
|
+
width: max(24px, var(--u-target-size, 0px));
|
|
77
|
+
height: max(24px, var(--u-target-size, 0px));
|
|
77
78
|
}
|
|
78
79
|
.prefix-toggler::before {
|
|
79
80
|
content: "";
|
|
@@ -115,8 +116,9 @@ var styles = css`
|
|
|
115
116
|
display: inline-flex;
|
|
116
117
|
align-items: center;
|
|
117
118
|
justify-content: center;
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
/* 호스트 하한(--u-target-size)이 있으면 그 값 — 미설정이면 24px 그대로. */
|
|
120
|
+
width: max(24px, var(--u-target-size, 0px));
|
|
121
|
+
height: max(24px, var(--u-target-size, 0px));
|
|
120
122
|
cursor: pointer;
|
|
121
123
|
}
|
|
122
124
|
.prefix-checkbox::before {
|