@iyulab/components 2.17.0 → 2.19.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 +29 -0
- package/README.md +9 -2
- package/dist/components/UElement.styles.js +8 -8
- package/dist/components/UFloatingElement.styles.js +6 -6
- package/dist/components/UOverlayElement.styles.js +1 -1
- package/dist/components/alert/UAlert.styles.js +12 -12
- package/dist/components/badge/UBadge.styles.js +13 -13
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +1 -1
- package/dist/components/button/UButton.styles.js +97 -97
- package/dist/components/button-group/UButtonGroup.styles.js +2 -2
- package/dist/components/calendar/UCalendar.styles.js +10 -10
- package/dist/components/calendar/picker.styles.js +14 -14
- package/dist/components/card/UCard.styles.js +3 -3
- package/dist/components/carousel/UCarousel.styles.js +8 -8
- package/dist/components/checkbox/UCheckbox.styles.js +26 -26
- package/dist/components/chip/UChip.styles.js +5 -5
- package/dist/components/copy-button/UCopyButton.styles.js +2 -2
- package/dist/components/date-picker/UDatePicker.styles.js +6 -6
- package/dist/components/date-range-picker/UDateRangePicker.styles.js +9 -9
- package/dist/components/dialog/UDialog.styles.js +8 -8
- package/dist/components/divider/UDivider.styles.js +14 -14
- package/dist/components/drawer/UDrawer.styles.js +19 -19
- package/dist/components/expander/UExpander.styles.js +13 -13
- package/dist/components/field/UField.styles.js +10 -10
- package/dist/components/file-input/UFileInput.styles.js +4 -4
- package/dist/components/form/UForm.styles.js +1 -1
- package/dist/components/icon/UIcon.styles.js +5 -5
- package/dist/components/icon-button/UIconButton.styles.js +1 -1
- package/dist/components/input/UInput.styles.js +40 -40
- package/dist/components/menu/UMenu.styles.js +1 -1
- package/dist/components/menu-item/UMenuItem.styles.js +8 -8
- package/dist/components/option/UOption.styles.js +5 -5
- package/dist/components/pagination/UPagination.styles.js +1 -1
- package/dist/components/panel/UPanel.styles.js +6 -6
- package/dist/components/progress-bar/UProgressBar.styles.js +10 -10
- package/dist/components/progress-ring/UProgressRing.styles.js +9 -9
- package/dist/components/radio/URadio.styles.js +12 -12
- package/dist/components/rating/URating.styles.js +6 -6
- package/dist/components/select/USelect.styles.js +37 -37
- package/dist/components/skeleton/USkeleton.styles.js +15 -15
- package/dist/components/slider/USlider.styles.js +17 -17
- package/dist/components/spinner/USpinner.styles.js +4 -4
- package/dist/components/split-panel/USplitPanel.styles.js +9 -9
- package/dist/components/steps/USteps.styles.js +5 -5
- package/dist/components/switch/USwitch.styles.js +13 -13
- package/dist/components/tab/UTab.styles.js +2 -2
- package/dist/components/tab-panel/UTabPanel.styles.js +4 -4
- package/dist/components/tag/UTag.styles.js +37 -37
- package/dist/components/text/UText.styles.js +18 -18
- package/dist/components/textarea/UTextarea.styles.js +14 -14
- package/dist/components/tooltip/UTooltip.styles.js +2 -2
- package/dist/components/tree/UTree.styles.js +3 -3
- package/dist/components/tree-item/UTreeItem.styles.js +18 -18
- package/dist/index.js +2 -2
- package/dist/plugins/vite-plugin-strip-css-comments.d.ts +29 -0
- package/dist/plugins/vite-plugin-strip-css-comments.js +186 -0
- package/dist/utilities/tsv.d.ts +9 -0
- package/dist/utilities/tsv.js +13 -2
- package/package.json +2 -2
- package/skills/iyulab-components/SKILL.md +2 -1
- package/skills/iyulab-components/references/usage.md +13 -0
|
@@ -7,16 +7,16 @@ var styles = css`
|
|
|
7
7
|
--tag-border-color: transparent;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
20
|
:host([color="primary"]) {
|
|
21
21
|
--tag-hue-solid: var(--u-primary-color, #1976D2);
|
|
22
22
|
--tag-hue-on-solid: var(--u-primary-txt-color, #FFFFFF);
|
|
@@ -58,15 +58,15 @@ var styles = css`
|
|
|
58
58
|
--tag-hue-text-outlined: var(--u-danger-color-strong, #C62828);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
70
|
:host([color="neutral"]) {
|
|
71
71
|
--tag-hue-solid: var(--u-neutral-700, #616161);
|
|
72
72
|
--tag-hue-line: var(--u-neutral-300, #E0E0E0);
|
|
@@ -88,7 +88,7 @@ var styles = css`
|
|
|
88
88
|
--tag-hue-text: var(--u-green-800, #2E7D32);
|
|
89
89
|
--tag-hue-text-outlined: var(--u-green-600, #43A047);
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
:host([color="yellow"]) {
|
|
93
93
|
--tag-hue-solid: var(--u-yellow-600, #FDD835);
|
|
94
94
|
--tag-hue-line: var(--u-yellow-300, #FFF176);
|
|
@@ -139,30 +139,30 @@ var styles = css`
|
|
|
139
139
|
--tag-hue-text-outlined: var(--u-pink-600, #D81B60);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
:host([appearance="solid"]) {
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
|
|
145
|
+
|
|
146
146
|
--tag-color: var(--tag-hue-on-solid, var(--u-neutral-0, #FFFFFF));
|
|
147
147
|
--tag-bg-color: var(--tag-hue-solid);
|
|
148
148
|
--tag-border-color: var(--tag-hue-solid);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
|
|
152
152
|
:host([appearance="soft"]) {
|
|
153
153
|
--tag-color: var(--tag-hue-text);
|
|
154
154
|
--tag-bg-color: var(--tag-hue-surface);
|
|
155
155
|
--tag-border-color: transparent;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
:host([appearance="outlined"]) {
|
|
160
160
|
--tag-color: var(--tag-hue-text-outlined);
|
|
161
161
|
--tag-bg-color: transparent;
|
|
162
162
|
--tag-border-color: var(--tag-hue-line);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
:host([appearance="plain"]) {
|
|
167
167
|
--tag-color: var(--tag-hue-text-outlined);
|
|
168
168
|
--tag-bg-color: transparent;
|
|
@@ -186,7 +186,7 @@ var styles = css`
|
|
|
186
186
|
box-sizing: border-box;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
.base {
|
|
191
191
|
box-sizing: border-box;
|
|
192
192
|
width: 100%;
|
|
@@ -197,7 +197,7 @@ var styles = css`
|
|
|
197
197
|
border: 1px solid var(--tag-border-color);
|
|
198
198
|
border-radius: inherit;
|
|
199
199
|
}
|
|
200
|
-
|
|
200
|
+
|
|
201
201
|
.icon {
|
|
202
202
|
flex-shrink: 0;
|
|
203
203
|
}
|
|
@@ -205,15 +205,15 @@ var styles = css`
|
|
|
205
205
|
border-radius: var(--u-radius-pill, 9999px);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
|
|
217
217
|
.content {
|
|
218
218
|
display: inline-block;
|
|
219
219
|
min-width: 0;
|
|
@@ -222,7 +222,7 @@ var styles = css`
|
|
|
222
222
|
text-overflow: ellipsis;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
|
|
226
226
|
.dot {
|
|
227
227
|
flex: none;
|
|
228
228
|
width: var(--tag-dot-size, 6px);
|
|
@@ -6,11 +6,11 @@ var styles = css`
|
|
|
6
6
|
color: var(--u-txt-color, #212121);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
14
|
.text {
|
|
15
15
|
margin: 0;
|
|
16
16
|
font-family: inherit;
|
|
@@ -55,14 +55,14 @@ var styles = css`
|
|
|
55
55
|
letter-spacing: var(--u-text-caption-tracking, 0);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
66
|
:host([variant="overline"]) .text {
|
|
67
67
|
font-size: var(--u-text-overline-size, 11px);
|
|
68
68
|
font-weight: var(--u-text-overline-weight, 700);
|
|
@@ -70,11 +70,11 @@ var styles = css`
|
|
|
70
70
|
letter-spacing: var(--u-text-overline-tracking, 0.06em);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
78
|
:host([tone="weak"]) {
|
|
79
79
|
color: var(--u-txt-color-weak, #616161);
|
|
80
80
|
}
|
|
@@ -2,19 +2,19 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/textarea/UTextarea.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
|
|
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
10
|
font-family: var(--u-font-base);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
.container {
|
|
15
15
|
display: flex;
|
|
16
16
|
padding: var(--u-field-padding-block, 0.3em) var(--u-field-padding-inline, 0.6em);
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
min-height: var(--u-target-size, 0px);
|
|
20
20
|
border: 1px solid var(--u-input-border-color, #E0E0E0);
|
|
@@ -37,7 +37,7 @@ var styles = css`
|
|
|
37
37
|
box-shadow: 0 0 0 1px var(--u-input-border-color-invalid, #C62828);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
:host([appearance="soft"]) .container {
|
|
42
42
|
border-color: transparent;
|
|
43
43
|
background-color: var(--u-neutral-200, #EEEEEE);
|
|
@@ -63,7 +63,7 @@ var styles = css`
|
|
|
63
63
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
:host([appearance="underlined"]) .container {
|
|
68
68
|
border: none;
|
|
69
69
|
border-radius: var(--u-radius-none, 0);
|
|
@@ -91,7 +91,7 @@ var styles = css`
|
|
|
91
91
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
|
|
95
95
|
:host([appearance="plain"]) .container {
|
|
96
96
|
border: none;
|
|
97
97
|
border-radius: var(--u-radius-none, 0);
|
|
@@ -103,14 +103,14 @@ var styles = css`
|
|
|
103
103
|
:host([appearance="plain"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
104
104
|
box-shadow: none;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
|
|
107
|
+
|
|
108
108
|
:host([appearance="plain"]:not(:disabled)) .container:focus-within {
|
|
109
109
|
outline: 2px solid var(--u-focus-ring-color, #1565C0);
|
|
110
110
|
outline-offset: 2px;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
textarea {
|
|
115
115
|
display: block;
|
|
116
116
|
border: none;
|
|
@@ -162,7 +162,7 @@ var styles = css`
|
|
|
162
162
|
resize: none;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
.counter {
|
|
167
167
|
margin-top: 0.25em;
|
|
168
168
|
text-align: right;
|
|
@@ -171,16 +171,16 @@ var styles = css`
|
|
|
171
171
|
line-height: 1.2;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
|
|
175
175
|
:host {
|
|
176
176
|
font-size: var(--u-density, 14px);
|
|
177
177
|
}
|
|
178
178
|
:host([size="sm"]) {
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
font-size: calc(var(--u-density, 14px) * 6 / 7);
|
|
181
181
|
}
|
|
182
182
|
:host([size="lg"]) {
|
|
183
|
-
|
|
183
|
+
|
|
184
184
|
font-size: calc(var(--u-density, 14px) * 8 / 7);
|
|
185
185
|
}
|
|
186
186
|
`;
|
|
@@ -20,7 +20,7 @@ var styles = css`
|
|
|
20
20
|
--tooltip-padding-inline: var(--u-space-sm, 8px);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
.base {
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
width: 100%;
|
|
@@ -31,7 +31,7 @@ var styles = css`
|
|
|
31
31
|
transform: scale(1);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
:host([interactive])::before {
|
|
36
36
|
content: '';
|
|
37
37
|
position: absolute;
|
|
@@ -11,9 +11,9 @@ var styles = css`
|
|
|
11
11
|
|
|
12
12
|
:host {
|
|
13
13
|
display: block;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
17
|
font-size: 0.875em;
|
|
18
18
|
color: var(--u-txt-color, #212121);
|
|
19
19
|
}
|
|
@@ -17,7 +17,7 @@ var styles = css`
|
|
|
17
17
|
pointer-events: none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
.header {
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: row;
|
|
@@ -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
|
-
);\n
|
|
29
|
+
);\n \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;
|
|
@@ -48,7 +48,7 @@ var styles = css`
|
|
|
48
48
|
margin-left: 0.2em;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
.content {
|
|
53
53
|
flex: 1;
|
|
54
54
|
min-width: 0;
|
|
@@ -58,12 +58,12 @@ var styles = css`
|
|
|
58
58
|
white-space: nowrap;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
67
|
.prefix-toggler {
|
|
68
68
|
position: relative;
|
|
69
69
|
box-sizing: border-box;
|
|
@@ -72,7 +72,7 @@ var styles = css`
|
|
|
72
72
|
display: inline-flex;
|
|
73
73
|
align-items: center;
|
|
74
74
|
justify-content: center;
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
width: max(24px, var(--u-target-size, 0px));
|
|
77
77
|
height: max(24px, var(--u-target-size, 0px));
|
|
78
78
|
}
|
|
@@ -94,9 +94,9 @@ var styles = css`
|
|
|
94
94
|
:host(:not([disabled])[trigger="icon"]:focus-visible) .prefix-toggler::before {
|
|
95
95
|
background-color: var(--u-bg-color-hover, #F5F5F5);
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
100
|
:host([checkable]) .prefix-toggler {
|
|
101
101
|
margin: -3px 4px -3px -6px;
|
|
102
102
|
padding-left: 6px;
|
|
@@ -105,9 +105,9 @@ var styles = css`
|
|
|
105
105
|
inset: 3px 0 3px 6px;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
111
|
.prefix-checkbox {
|
|
112
112
|
position: relative;
|
|
113
113
|
box-sizing: border-box;
|
|
@@ -116,7 +116,7 @@ var styles = css`
|
|
|
116
116
|
display: inline-flex;
|
|
117
117
|
align-items: center;
|
|
118
118
|
justify-content: center;
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
width: max(24px, var(--u-target-size, 0px));
|
|
121
121
|
height: max(24px, var(--u-target-size, 0px));
|
|
122
122
|
cursor: pointer;
|
|
@@ -148,7 +148,7 @@ var styles = css`
|
|
|
148
148
|
visibility: visible;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
|
|
152
152
|
.subtree {
|
|
153
153
|
display: block;
|
|
154
154
|
position: relative;
|
package/dist/index.js
CHANGED
|
@@ -64,5 +64,5 @@ import { copyFromKey, isTextEntry, pasteFromKey } from "./utilities/clipboard.js
|
|
|
64
64
|
import { Dialog } from "./utilities/Dialog.js";
|
|
65
65
|
import { Theme } from "./utilities/Theme.js";
|
|
66
66
|
import { Toast } from "./utilities/Toast.js";
|
|
67
|
-
import { decodeTsv, encodeTsv } from "./utilities/tsv.js";
|
|
68
|
-
export { ALERT_STATUSES, BrowserStorage, 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, decodeTsv, devWarnOnce, encodeTsv, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, isCoarsePointer, isFocusCandidate, isFromControl, isImeComposing, isTextEntry, jsonAttrConverter, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter };
|
|
67
|
+
import { decodeDelimited, decodeTsv, encodeTsv } from "./utilities/tsv.js";
|
|
68
|
+
export { ALERT_STATUSES, BrowserStorage, 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, devWarnOnce, encodeTsv, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, isCoarsePointer, isFocusCandidate, isFromControl, isImeComposing, isTextEntry, jsonAttrConverter, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Strips block comments (`/* … *\/`) from inside `css\`…\`` tagged templates.
|
|
4
|
+
*
|
|
5
|
+
* Why this exists: esbuild minifies JavaScript, but the body of a tagged template is a string
|
|
6
|
+
* literal, so a CSS comment written inside `css\`…\`` is shipped verbatim to every consumer. The
|
|
7
|
+
* design notes that explain a style rule belong in the source, not in the bundle — they cost
|
|
8
|
+
* gzip bytes against the size budget and leak internal context into a public artifact.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately narrow: only `css\`` templates (not `html\``, whose whitespace is significant to
|
|
11
|
+
* rendering), only block comments, and never a comment that contains `${` — inside a template
|
|
12
|
+
* literal that is still an expression, not comment text, and rewriting it would change behavior.
|
|
13
|
+
* Each removed comment is replaced by the newlines it contained, so line numbers in the source
|
|
14
|
+
* map stay aligned.
|
|
15
|
+
*/
|
|
16
|
+
export declare function stripCssTemplateComments(source: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Vite plugin: strips block comments from `css` tagged templates in the package's own sources before esbuild
|
|
19
|
+
* sees them (see `stripCssTemplateComments`).
|
|
20
|
+
*
|
|
21
|
+
* Only the package's `src/**` TypeScript that is not a test is touched — the transform's own fixtures live in
|
|
22
|
+
* tests, and a dependency's code is not ours to rewrite. Use it in every package that ships Lit styles:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import stripCssComments from '@iyulab/components/plugins/vite-plugin-strip-css-comments.js';
|
|
26
|
+
* export default defineConfig({ plugins: [stripCssComments()] });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export default function stripCssComments(): Plugin;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
/**
|
|
3
|
+
* Strips block comments (`/* … *\/`) from inside `css\`…\`` tagged templates.
|
|
4
|
+
*
|
|
5
|
+
* Why this exists: esbuild minifies JavaScript, but the body of a tagged template is a string
|
|
6
|
+
* literal, so a CSS comment written inside `css\`…\`` is shipped verbatim to every consumer. The
|
|
7
|
+
* design notes that explain a style rule belong in the source, not in the bundle — they cost
|
|
8
|
+
* gzip bytes against the size budget and leak internal context into a public artifact.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately narrow: only `css\`` templates (not `html\``, whose whitespace is significant to
|
|
11
|
+
* rendering), only block comments, and never a comment that contains `${` — inside a template
|
|
12
|
+
* literal that is still an expression, not comment text, and rewriting it would change behavior.
|
|
13
|
+
* Each removed comment is replaced by the newlines it contained, so line numbers in the source
|
|
14
|
+
* map stay aligned.
|
|
15
|
+
*/
|
|
16
|
+
export function stripCssTemplateComments(source) {
|
|
17
|
+
let out = '';
|
|
18
|
+
let cursor = 0;
|
|
19
|
+
while (cursor < source.length) {
|
|
20
|
+
const start = findCssTemplateStart(source, cursor);
|
|
21
|
+
if (start === -1) {
|
|
22
|
+
out += source.slice(cursor);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
const bodyStart = start + 'css`'.length;
|
|
26
|
+
out += source.slice(cursor, bodyStart);
|
|
27
|
+
const { text, end } = stripTemplateBody(source, bodyStart);
|
|
28
|
+
out += text;
|
|
29
|
+
cursor = end;
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/** Index of the next `css\`` whose `css` is a whole identifier (so `unsafeCSS\`` is not matched). */
|
|
34
|
+
function findCssTemplateStart(source, from) {
|
|
35
|
+
let i = source.indexOf('css`', from);
|
|
36
|
+
while (i !== -1) {
|
|
37
|
+
const before = i === 0 ? '' : source[i - 1];
|
|
38
|
+
if (!/[\w$]/.test(before))
|
|
39
|
+
return i;
|
|
40
|
+
i = source.indexOf('css`', i + 1);
|
|
41
|
+
}
|
|
42
|
+
return -1;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Walks one template body starting just after the opening backtick. Returns the rewritten body
|
|
46
|
+
* (including the closing backtick) and the index just past it. `${…}` expressions are copied
|
|
47
|
+
* through untouched, including nested template literals inside them.
|
|
48
|
+
*/
|
|
49
|
+
function stripTemplateBody(source, from) {
|
|
50
|
+
let text = '';
|
|
51
|
+
let i = from;
|
|
52
|
+
while (i < source.length) {
|
|
53
|
+
const ch = source[i];
|
|
54
|
+
if (ch === '\\') {
|
|
55
|
+
text += source.slice(i, i + 2);
|
|
56
|
+
i += 2;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (ch === '`') {
|
|
60
|
+
return { text: text + '`', end: i + 1 };
|
|
61
|
+
}
|
|
62
|
+
if (ch === '$' && source[i + 1] === '{') {
|
|
63
|
+
const exprEnd = skipExpression(source, i + 2);
|
|
64
|
+
text += source.slice(i, exprEnd);
|
|
65
|
+
i = exprEnd;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (ch === '/' && source[i + 1] === '*') {
|
|
69
|
+
const close = source.indexOf('*/', i + 2);
|
|
70
|
+
const templateEnd = source.indexOf('`', i + 2);
|
|
71
|
+
// A `*/` that lies beyond this template's closing backtick belongs to something else —
|
|
72
|
+
// the comment is unterminated within the template. Leave it (and a comment holding an
|
|
73
|
+
// expression) exactly as written rather than swallowing source past the template.
|
|
74
|
+
const unterminated = close === -1 || (templateEnd !== -1 && templateEnd < close);
|
|
75
|
+
if (unterminated) {
|
|
76
|
+
text += source.slice(i, i + 2);
|
|
77
|
+
i += 2;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const commentEnd = close + 2;
|
|
81
|
+
const comment = source.slice(i, commentEnd);
|
|
82
|
+
text += comment.includes('${') ? comment : comment.replace(/[^\n]/g, '');
|
|
83
|
+
i = commentEnd;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
text += ch;
|
|
87
|
+
i++;
|
|
88
|
+
}
|
|
89
|
+
return { text, end: i };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Given the index just after `${`, returns the index just after the matching `}`. Tracks brace
|
|
93
|
+
* depth and skips string and template literals (recursing into nested templates so a `}` inside
|
|
94
|
+
* them is not miscounted).
|
|
95
|
+
*/
|
|
96
|
+
function skipExpression(source, from) {
|
|
97
|
+
let depth = 1;
|
|
98
|
+
let i = from;
|
|
99
|
+
while (i < source.length) {
|
|
100
|
+
const ch = source[i];
|
|
101
|
+
if (ch === '\\') {
|
|
102
|
+
i += 2;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (ch === '\'' || ch === '"') {
|
|
106
|
+
i = skipQuoted(source, i + 1, ch);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (ch === '`') {
|
|
110
|
+
i = skipTemplate(source, i + 1);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (ch === '{')
|
|
114
|
+
depth++;
|
|
115
|
+
if (ch === '}') {
|
|
116
|
+
depth--;
|
|
117
|
+
if (depth === 0)
|
|
118
|
+
return i + 1;
|
|
119
|
+
}
|
|
120
|
+
i++;
|
|
121
|
+
}
|
|
122
|
+
return i;
|
|
123
|
+
}
|
|
124
|
+
function skipQuoted(source, from, quote) {
|
|
125
|
+
let i = from;
|
|
126
|
+
while (i < source.length) {
|
|
127
|
+
if (source[i] === '\\') {
|
|
128
|
+
i += 2;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (source[i] === quote)
|
|
132
|
+
return i + 1;
|
|
133
|
+
i++;
|
|
134
|
+
}
|
|
135
|
+
return i;
|
|
136
|
+
}
|
|
137
|
+
/** Index just past the closing backtick of a nested template literal (its `${…}` handled too). */
|
|
138
|
+
function skipTemplate(source, from) {
|
|
139
|
+
let i = from;
|
|
140
|
+
while (i < source.length) {
|
|
141
|
+
const ch = source[i];
|
|
142
|
+
if (ch === '\\') {
|
|
143
|
+
i += 2;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (ch === '`')
|
|
147
|
+
return i + 1;
|
|
148
|
+
if (ch === '$' && source[i + 1] === '{') {
|
|
149
|
+
i = skipExpression(source, i + 2);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
i++;
|
|
153
|
+
}
|
|
154
|
+
return i;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Vite plugin: strips block comments from `css` tagged templates in the package's own sources before esbuild
|
|
158
|
+
* sees them (see `stripCssTemplateComments`).
|
|
159
|
+
*
|
|
160
|
+
* Only the package's `src/**` TypeScript that is not a test is touched — the transform's own fixtures live in
|
|
161
|
+
* tests, and a dependency's code is not ours to rewrite. Use it in every package that ships Lit styles:
|
|
162
|
+
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* import stripCssComments from '@iyulab/components/plugins/vite-plugin-strip-css-comments.js';
|
|
165
|
+
* export default defineConfig({ plugins: [stripCssComments()] });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export default function stripCssComments() {
|
|
169
|
+
let srcDir = '';
|
|
170
|
+
return {
|
|
171
|
+
name: 'iyulab:strip-css-comments',
|
|
172
|
+
enforce: 'pre',
|
|
173
|
+
configResolved(config) {
|
|
174
|
+
srcDir = resolve(config.root, 'src').replace(/\\/g, '/') + '/';
|
|
175
|
+
},
|
|
176
|
+
transform(code, id) {
|
|
177
|
+
const file = id.split('?')[0].replace(/\\/g, '/');
|
|
178
|
+
if (!file.startsWith(srcDir) || !file.endsWith('.ts') || /\.(test|spec)\.ts$/.test(file))
|
|
179
|
+
return null;
|
|
180
|
+
if (!code.includes('css`'))
|
|
181
|
+
return null;
|
|
182
|
+
const out = stripCssTemplateComments(code);
|
|
183
|
+
return out === code ? null : { code: out, map: null };
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
package/dist/utilities/tsv.d.ts
CHANGED
|
@@ -26,3 +26,12 @@ export declare function encodeTsv(rows: readonly (readonly string[])[]): string;
|
|
|
26
26
|
* // [['가', '첫 줄\r\n둘째 줄']]
|
|
27
27
|
*/
|
|
28
28
|
export declare function decodeTsv(text: string): string[][];
|
|
29
|
+
/**
|
|
30
|
+
* 구분자로 나뉜 텍스트(CSV · TSV · 세미콜론 CSV)를 2차원 셀 배열로 읽습니다 — 인용 규칙은 `decodeTsv` 와 같고(RFC 4180),
|
|
31
|
+
* 다른 것은 칸을 나누는 글자뿐입니다. 파일 앞의 BOM 은 읽는 쪽이 걷습니다(이 함수는 글자를 바꾸지 않습니다).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* decodeDelimited('이름,비고\n가,"쉼표, 든 칸"', ',');
|
|
35
|
+
* // [['이름', '비고'], ['가', '쉼표, 든 칸']]
|
|
36
|
+
*/
|
|
37
|
+
export declare function decodeDelimited(text: string, delimiter: string): string[][];
|