@iyulab/components 3.2.0 → 3.3.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 +31 -0
- package/README.md +10 -4
- package/dist/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/decorateMetadata.js +1 -1
- package/dist/components/UElement.js +1 -1
- package/dist/components/UFloatingElement.d.ts +3 -0
- package/dist/components/UFloatingElement.js +25 -11
- package/dist/components/UFloatingElement.styles.js +1 -1
- package/dist/components/UFormControlElement.js +5 -4
- package/dist/components/UOverlayElement.js +4 -4
- package/dist/components/alert/UAlert.js +4 -4
- package/dist/components/auto-scroll/UAutoScroll.js +4 -4
- package/dist/components/avatar/UAvatar.js +4 -4
- package/dist/components/badge/UBadge.js +4 -4
- package/dist/components/breadcrumb/UBreadcrumb.js +3 -3
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +5 -5
- package/dist/components/button/UButton.js +5 -5
- package/dist/components/button-group/UButtonGroup.js +4 -4
- package/dist/components/calendar/UCalendar.js +5 -5
- package/dist/components/card/UCard.js +5 -5
- package/dist/components/carousel/UCarousel.js +6 -6
- package/dist/components/checkbox/UCheckbox.js +6 -6
- package/dist/components/chip/UChip.js +4 -4
- package/dist/components/command-palette/UCommandPalette.js +5 -5
- package/dist/components/copy-button/UCopyButton.js +4 -4
- package/dist/components/date-picker/UDatePicker.js +7 -6
- package/dist/components/date-range-picker/UDateRangePicker.js +7 -6
- package/dist/components/dialog/UDialog.js +4 -4
- package/dist/components/divider/UDivider.js +4 -4
- package/dist/components/drawer/UDrawer.js +4 -4
- package/dist/components/expander/UExpander.js +4 -4
- package/dist/components/field/UField.js +7 -6
- package/dist/components/file-input/UFileInput.js +5 -5
- package/dist/components/form/UForm.js +4 -4
- package/dist/components/icon/UIcon.js +6 -6
- package/dist/components/icon-button/UIconButton.js +5 -5
- package/dist/components/input/UInput.js +6 -6
- package/dist/components/menu/UMenu.js +4 -4
- package/dist/components/menu-item/UMenuItem.js +5 -5
- package/dist/components/option/UOption.js +4 -4
- package/dist/components/option-group/UOptionGroup.js +7 -6
- package/dist/components/option-group/UOptionGroup.styles.js +2 -1
- package/dist/components/pagination/UPagination.js +4 -4
- package/dist/components/panel/UPanel.js +4 -4
- package/dist/components/popover/UPopover.js +4 -4
- package/dist/components/progress-bar/UProgressBar.js +4 -4
- package/dist/components/progress-ring/UProgressRing.js +4 -4
- package/dist/components/radio/URadio.js +5 -5
- package/dist/components/rating/URating.js +5 -5
- package/dist/components/select/USelect.js +7 -6
- package/dist/components/skeleton/USkeleton.js +4 -4
- package/dist/components/slider/USlider.js +5 -5
- package/dist/components/spinner/USpinner.js +4 -4
- package/dist/components/split-panel/USplitPanel.js +4 -4
- package/dist/components/steps/USteps.js +5 -5
- package/dist/components/switch/USwitch.js +6 -6
- package/dist/components/tab/UTab.js +5 -5
- package/dist/components/tab-nav/UTabNav.js +4 -4
- package/dist/components/tab-panel/UTabPanel.js +4 -4
- package/dist/components/tag/UTag.js +4 -4
- package/dist/components/text/UText.js +4 -4
- package/dist/components/textarea/UTextarea.js +7 -7
- package/dist/components/tooltip/UTooltip.js +4 -4
- package/dist/components/tree/UTree.js +4 -4
- package/dist/components/tree-item/UTreeItem.js +4 -4
- package/dist/custom-elements.json +420 -249
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/utilities/Dialog.js +3 -3
- package/dist/utilities/customState.d.ts +19 -0
- package/dist/utilities/customState.js +40 -0
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export * from './utilities/BrowserStorage.js';
|
|
|
68
68
|
export * from './utilities/clipboard.js';
|
|
69
69
|
export * from './utilities/collation.js';
|
|
70
70
|
export * from './utilities/converters.js';
|
|
71
|
+
export * from './utilities/customState.js';
|
|
71
72
|
export * from './utilities/dateValue.js';
|
|
72
73
|
export * from './utilities/devWarning.js';
|
|
73
74
|
export * from './utilities/enumerated.js';
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ import { BrowserStorage } from "./utilities/BrowserStorage.js";
|
|
|
59
59
|
import { copyFromKey, isTextEntry, pasteFromKey } from "./utilities/clipboard.js";
|
|
60
60
|
import { compareText, getCollator } from "./utilities/collation.js";
|
|
61
61
|
import { arrayAttrConverter, booleanAttrConverter, dateAttrConverter, jsonAttrConverter, urlAttrConverter } from "./utilities/converters.js";
|
|
62
|
+
import { hasCustomState, setCustomState } from "./utilities/customState.js";
|
|
62
63
|
import { localOffset, readDateValue, writeInstant, writePlainDate, writePlainDateTime } from "./utilities/dateValue.js";
|
|
63
64
|
import { createDevWarner, devWarnOnce, resetDevWarnings } from "./utilities/devWarning.js";
|
|
64
65
|
import { enumeratedValues } from "./utilities/enumerated.js";
|
|
@@ -76,4 +77,4 @@ import { OverlayManager } from "./utilities/OverlayManager.js";
|
|
|
76
77
|
import { Theme } from "./utilities/Theme.js";
|
|
77
78
|
import { Toast } from "./utilities/Toast.js";
|
|
78
79
|
import { decodeDelimited, decodeTsv, encodeTsv } from "./utilities/tsv.js";
|
|
79
|
-
export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAutoScroll, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCommandPalette, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOptionGroup, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabNav, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, applyNumberFormat, arrayAttrConverter, booleanAttrConverter, collectOptions, compareText, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, delegate, devWarnOnce, encodeTsv, enumeratedValues, filterCommands, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getCollator, getDefaultBaseUrl, getParentElement, hangulKeystrokes, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, listenInShadow, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
|
|
80
|
+
export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAutoScroll, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCommandPalette, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOptionGroup, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabNav, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, applyNumberFormat, arrayAttrConverter, booleanAttrConverter, collectOptions, compareText, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, delegate, devWarnOnce, encodeTsv, enumeratedValues, filterCommands, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getCollator, getDefaultBaseUrl, getParentElement, hangulKeystrokes, hasCustomState, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, listenInShadow, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setCustomState, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
|
package/dist/utilities/Dialog.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { html, nothing, render } from "lit";
|
|
1
2
|
import "../components/button/UButton.js";
|
|
2
3
|
import { UDialog } from "../components/dialog/UDialog.js";
|
|
4
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
5
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
6
|
import { Locale } from "./Locale.js";
|
|
4
7
|
import { isImeComposing } from "./keyboard.js";
|
|
5
|
-
import { html, nothing, render } from "lit";
|
|
6
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
8
8
|
// src/utilities/Dialog.ts
|
|
9
9
|
/**
|
|
10
10
|
* 메시지를 본문 템플릿으로 — 문자열은 lit 이 글자로 이스케이프한다. `show` 는 문자열 `content` 를 HTML 로 해석하므로
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ElementInternals.states` 에 상태를 싣고 읽는 길 — 접두 없는 이름을 거부하는 Chromium(90–124)에서도 던지지 않는다.
|
|
3
|
+
*
|
|
4
|
+
* 컴포넌트는 `:state(open)` · `:state(field)` 같은 공개 표지를 낸다. 125 이전 Chromium 의 `CustomStateSet` 은 `--` 로
|
|
5
|
+
* 시작하지 않는 이름을 `SyntaxError` 로 거부하고(`:state(x)` 도 모르는 선택자라 규칙째 버려진다), 대신 `--x` 와
|
|
6
|
+
* `:--x` 를 받는다. 그래서 상태를 켜고 끌 때는 접두 없는 이름을 먼저 시도하고 거부당하면 `--이름` 으로 다시 한다 —
|
|
7
|
+
* 125+ 경로는 그대로이고, 낡은 엔진에서는 컨트롤이 연결될 때 던지던 예외가 사라진다. 스타일시트는 `:is(:state(x), :--x)`
|
|
8
|
+
* 로 두 형을 한 규칙에 쓴다(`:is()` 는 모르는 선택자를 버리고 나머지로 계속하므로 규칙이 통째로 죽지 않는다).
|
|
9
|
+
*
|
|
10
|
+
* `states` 자체가 없는 엔진(Chromium 90 미만 · Firefox 126 미만 · Safari 17.4 미만)에서는 아무것도 하지 않는다 —
|
|
11
|
+
* 상태는 꾸밈 손잡이일 뿐이라 없어도 컴포넌트의 동작은 같다.
|
|
12
|
+
*/
|
|
13
|
+
export declare function setCustomState(internals: ElementInternals | null | undefined, name: string, on: boolean): void;
|
|
14
|
+
/**
|
|
15
|
+
* 요소가 그 상태를 싣고 있는가 — `setCustomState` 가 어느 형으로 실었든 읽는다. 접두 없는 `:state(x)`(125+) ·
|
|
16
|
+
* 접두 형을 담은 집합을 125+ 가 읽는 `:state(--x)` · 125 미만 Chromium 의 `:--x`. 셋을 `:is()` 에 담아 모르는 형을 버린다.
|
|
17
|
+
* `:is()` 조차 모르는 엔진에서는 `matches` 가 `SyntaxError` 를 던지므로 그때는 «아니오» 다.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hasCustomState(element: Element, name: string): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/utilities/customState.ts
|
|
2
|
+
/**
|
|
3
|
+
* `ElementInternals.states` 에 상태를 싣고 읽는 길 — 접두 없는 이름을 거부하는 Chromium(90–124)에서도 던지지 않는다.
|
|
4
|
+
*
|
|
5
|
+
* 컴포넌트는 `:state(open)` · `:state(field)` 같은 공개 표지를 낸다. 125 이전 Chromium 의 `CustomStateSet` 은 `--` 로
|
|
6
|
+
* 시작하지 않는 이름을 `SyntaxError` 로 거부하고(`:state(x)` 도 모르는 선택자라 규칙째 버려진다), 대신 `--x` 와
|
|
7
|
+
* `:--x` 를 받는다. 그래서 상태를 켜고 끌 때는 접두 없는 이름을 먼저 시도하고 거부당하면 `--이름` 으로 다시 한다 —
|
|
8
|
+
* 125+ 경로는 그대로이고, 낡은 엔진에서는 컨트롤이 연결될 때 던지던 예외가 사라진다. 스타일시트는 `:is(:state(x), :--x)`
|
|
9
|
+
* 로 두 형을 한 규칙에 쓴다(`:is()` 는 모르는 선택자를 버리고 나머지로 계속하므로 규칙이 통째로 죽지 않는다).
|
|
10
|
+
*
|
|
11
|
+
* `states` 자체가 없는 엔진(Chromium 90 미만 · Firefox 126 미만 · Safari 17.4 미만)에서는 아무것도 하지 않는다 —
|
|
12
|
+
* 상태는 꾸밈 손잡이일 뿐이라 없어도 컴포넌트의 동작은 같다.
|
|
13
|
+
*/
|
|
14
|
+
function setCustomState(internals, name, on) {
|
|
15
|
+
const states = internals?.states;
|
|
16
|
+
if (!states) return;
|
|
17
|
+
const op = on ? "add" : "delete";
|
|
18
|
+
try {
|
|
19
|
+
states[op](name);
|
|
20
|
+
return;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (!(error instanceof DOMException && error.name === "SyntaxError")) throw error;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
states[op](`--${name}`);
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 요소가 그 상태를 싣고 있는가 — `setCustomState` 가 어느 형으로 실었든 읽는다. 접두 없는 `:state(x)`(125+) ·
|
|
30
|
+
* 접두 형을 담은 집합을 125+ 가 읽는 `:state(--x)` · 125 미만 Chromium 의 `:--x`. 셋을 `:is()` 에 담아 모르는 형을 버린다.
|
|
31
|
+
* `:is()` 조차 모르는 엔진에서는 `matches` 가 `SyntaxError` 를 던지므로 그때는 «아니오» 다.
|
|
32
|
+
*/
|
|
33
|
+
function hasCustomState(element, name) {
|
|
34
|
+
try {
|
|
35
|
+
return element.matches(`:is(:state(${name}), :state(--${name}), :--${name})`);
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { hasCustomState, setCustomState };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/components",
|
|
3
3
|
"description": "Lit-based UI elements for business web apps: buttons, inputs, selects, date pickers, dialogs, design tokens, theming and a locale registry",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iyulab",
|
|
7
7
|
"components",
|
|
@@ -43,7 +43,7 @@ import { UButton, UInput } from '@iyulab/components/react';
|
|
|
43
43
|
|
|
44
44
|
> For detailed guidance on theming, icon setup, and advanced usage, see [./references/usage.md](./references/usage.md).
|
|
45
45
|
|
|
46
|
-
> **Browser support:** the floor is the browsers that
|
|
46
|
+
> **Browser support:** the floor is the browsers that have `ElementInternals.states` — Chrome/Edge 90, Firefox 126, Safari 17.4. Chrome/Edge below 125 only accept `--`-prefixed state names, so the components try the plain name and fall back to `--name` (nothing throws), and the built-in sheets read both forms with `:is(:state(x), :--x)`. Below the floor there are no states at all: state-driven looks do not apply, behaviour is unchanged. An app sheet that styles a published state (`u-select:state(open)`) and must cover Chrome/Edge below 125 writes the same two forms; `setCustomState(internals, name, on)` and `hasCustomState(el, name)` are exported for custom elements that publish their own.
|
|
47
47
|
|
|
48
48
|
> **Direction:** layout follows the document direction — under `dir="rtl"` the prefix/suffix slots, inner padding and borders mirror (logical CSS properties). Placement values that name a physical side (`u-drawer placement="left"`, `u-tab-panel placement`) stay physical. The chevrons a component draws itself mirror too (breadcrumb separator, previous/next in pagination and calendar, the closed marker of expander and tree item, the submenu marker) — a chevron you pass through a `separator` or `expand-icon` slot stays as you drew it. Script-positioned parts follow the pointer and the arrow keys in a right-to-left page (`u-split-panel`, `u-slider`, `u-rating`, `u-carousel`). The badge corner placements stay physical on purpose; the virtualized grid and spreadsheet are mirrored in `@iyulab/flex-table` and `@iyulab/data-components`, and the timeline keeps time left to right. Values the app puts in (a name, a part number, a signed number) read in their own direction instead of the page's — `u-tag`, `u-chip`, `u-option`, `u-breadcrumb-item`, `u-button`, `u-menu-item`, `u-tree-item`, `u-checkbox`, `u-radio`, `u-switch`, `u-tab`, `u-badge`, the `u-divider` text, the `u-progress-bar` content, the `u-steps` titles and the closed `u-select` trigger isolate their one-line label with a shadow-tree `bdi` (`Blue Harbor Co.` stays `Blue Harbor Co.` in an RTL page; alignment is unchanged). Sentences (toast and alert bodies, descriptions) follow the page; wrap a value you interpolate into a sentence in `<bdi>` yourself.
|
|
49
49
|
|