tyrell-components 1.0.0-RC15 → 1.0.0-RC17
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/README.md +44 -52
- package/css/tyrell-colors-static.css +14 -0
- package/css/tyrell-theme.css +13 -7
- package/css/tyrell.css +15 -22
- package/dist/tyrell-colors-static.css +1 -1
- package/dist/tyrell-theme.css +1 -1
- package/dist/tyrell.css +1 -1
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +37 -15
- package/lib/base/ty-component.js +90 -26
- package/lib/components/button.d.ts +14 -0
- package/lib/components/button.js +61 -7
- package/lib/components/calendar-month.d.ts +7 -1
- package/lib/components/calendar-month.js +38 -30
- package/lib/components/calendar-navigation.d.ts +11 -0
- package/lib/components/calendar-navigation.js +68 -44
- package/lib/components/calendar.d.ts +52 -3
- package/lib/components/calendar.js +274 -61
- package/lib/components/checkbox.d.ts +8 -1
- package/lib/components/checkbox.js +29 -8
- package/lib/components/copy.d.ts +2 -0
- package/lib/components/copy.js +24 -33
- package/lib/components/date-picker.d.ts +68 -34
- package/lib/components/date-picker.js +386 -389
- package/lib/components/file-upload.d.ts +7 -0
- package/lib/components/file-upload.js +36 -4
- package/lib/components/input.d.ts +73 -3
- package/lib/components/input.js +159 -24
- package/lib/components/modal.d.ts +4 -8
- package/lib/components/modal.js +103 -33
- package/lib/components/option.js +7 -5
- package/lib/components/popup.js +117 -14
- package/lib/components/radio.d.ts +24 -0
- package/lib/components/radio.js +55 -32
- package/lib/components/resize-observer.js +2 -0
- package/lib/components/scroll-container.d.ts +3 -2
- package/lib/components/scroll-container.js +7 -8
- package/lib/components/select.d.ts +68 -11
- package/lib/components/select.js +196 -44
- package/lib/components/selected-tags.d.ts +7 -1
- package/lib/components/selected-tags.js +10 -1
- package/lib/components/switch.d.ts +9 -1
- package/lib/components/switch.js +29 -8
- package/lib/components/tab.d.ts +49 -1
- package/lib/components/tab.js +151 -10
- package/lib/components/tabs.d.ts +14 -2
- package/lib/components/tabs.js +185 -136
- package/lib/components/tag.d.ts +4 -7
- package/lib/components/tag.js +6 -7
- package/lib/components/textarea.d.ts +51 -5
- package/lib/components/textarea.js +95 -30
- package/lib/components/tooltip.d.ts +4 -3
- package/lib/components/tooltip.js +34 -24
- package/lib/components/wizard.d.ts +5 -4
- package/lib/components/wizard.js +120 -156
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/styles/button.js +21 -19
- package/lib/styles/calendar-month.d.ts +3 -0
- package/lib/styles/calendar-month.js +43 -27
- package/lib/styles/calendar-navigation.d.ts +1 -1
- package/lib/styles/calendar-navigation.js +55 -26
- package/lib/styles/calendar.d.ts +3 -2
- package/lib/styles/calendar.js +77 -0
- package/lib/styles/checkbox.js +31 -13
- package/lib/styles/copy.js +5 -1
- package/lib/styles/date-picker.js +68 -26
- package/lib/styles/file-upload.d.ts +1 -1
- package/lib/styles/file-upload.js +3 -3
- package/lib/styles/icon.d.ts +1 -1
- package/lib/styles/icon.js +2 -2
- package/lib/styles/input.js +6 -10
- package/lib/styles/option.d.ts +1 -1
- package/lib/styles/option.js +7 -3
- package/lib/styles/popup.d.ts +1 -1
- package/lib/styles/popup.js +10 -5
- package/lib/styles/radio.js +18 -6
- package/lib/styles/scroll-container.d.ts +1 -1
- package/lib/styles/scroll-container.js +1 -1
- package/lib/styles/select-base.js +24 -3
- package/lib/styles/select.d.ts +1 -1
- package/lib/styles/select.js +10 -0
- package/lib/styles/step.d.ts +1 -1
- package/lib/styles/step.js +1 -9
- package/lib/styles/switch.js +14 -6
- package/lib/styles/tab.d.ts +1 -1
- package/lib/styles/tab.js +67 -3
- package/lib/styles/tabs.d.ts +1 -1
- package/lib/styles/tabs.js +7 -3
- package/lib/styles/tag.js +3 -3
- package/lib/styles/textarea.d.ts +1 -1
- package/lib/styles/textarea.js +7 -0
- package/lib/styles/wizard.d.ts +9 -5
- package/lib/styles/wizard.js +211 -99
- package/lib/types/common.d.ts +2 -2
- package/lib/utils/calendar-utils.d.ts +49 -0
- package/lib/utils/calendar-utils.js +63 -6
- package/lib/utils/property-manager.d.ts +7 -1
- package/lib/utils/property-manager.js +16 -4
- package/lib/utils/scroll-lock.d.ts +10 -4
- package/lib/utils/scroll-lock.js +102 -2
- package/lib/utils/upgrade-properties.d.ts +21 -0
- package/lib/utils/upgrade-properties.js +47 -0
- package/lib/utils/validity.d.ts +122 -0
- package/lib/utils/validity.js +289 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +27 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Calendar Navigation Styles */
|
|
2
|
-
export declare const calendarNavigationStyles = "\n/* Theming tokens applied as var(--ty-calendar-nav-*, <default>) at point of\n use (NOT on :host) so consumers can override them from outside \u2014 this\n component is nested inside ty-calendar's shadow, so a :host default would\n block inherited overrides. --ty-calendar-accent still cascades in. */\n\n:host([data-size=\"md\"]) {\n --nav-btn-size:
|
|
2
|
+
export declare const calendarNavigationStyles = "\n/* Theming tokens applied as var(--ty-calendar-nav-*, <default>) at point of\n use (NOT on :host) so consumers can override them from outside \u2014 this\n component is nested inside ty-calendar's shadow, so a :host default would\n block inherited overrides. --ty-calendar-accent still cascades in. */\n\n:host([data-size=\"md\"]) {\n --nav-btn-size: 1.875rem;\n --nav-btn-icon-size: 1.125rem;\n --nav-font-size: 1rem;\n --nav-padding: 0.5rem 0.75rem;\n --nav-default-width: 280px;\n}\n\n:host([data-size=\"sm\"]) {\n --nav-btn-size: 1.5rem;\n --nav-btn-icon-size: 0.9375rem;\n --nav-font-size: 0.875rem;\n --nav-padding: 0.375rem 0.5rem;\n --nav-default-width: 240px;\n}\n\n:host([data-size=\"lg\"]) {\n --nav-btn-size: 2.25rem;\n --nav-btn-icon-size: 1.25rem;\n --nav-font-size: 1.125rem;\n --nav-padding: 0.625rem 1rem;\n --nav-default-width: 360px;\n}\n\n.calendar-navigation-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--nav-padding);\n font-family: inherit;\n user-select: none;\n /* --ty-calendar-width is the public knob: set it on ty-calendar (or any\n ancestor) and BOTH the nav and the day grid follow it, because custom\n properties inherit through shadow boundaries. --nav-default-width can't\n serve that role \u2014 it's declared on :host([data-size]) inside this shadow\n root, and a declaration on the element always beats a value inherited\n into it, so an outside override of it is silently dead. --nav-width\n (set inline by the width attribute) still wins over both. */\n width: var(--nav-width, var(--ty-calendar-width, var(--nav-default-width)));\n box-sizing: border-box;\n}\n\n/* Title (left) opens the month/year view; arrows (right) step months, or\n years while that view is open. */\n.nav-group {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n flex: 0 0 auto;\n}\n\n.nav-title {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n min-width: 0;\n margin-left: -0.375rem;\n padding: 0.25rem 0.375rem;\n border: none;\n border-radius: var(--ty-radius-base);\n background: transparent;\n font-family: inherit;\n font-size: var(--nav-font-size);\n line-height: 1.2;\n white-space: nowrap;\n cursor: pointer;\n transition: var(--ty-local-transition, background-color 0.15s ease);\n outline: none;\n}\n\n.nav-title:hover,\n.nav-title[aria-expanded=\"true\"] {\n background-color: var(--ty-calendar-nav-hover-bg, var(--ty-bg-neutral-soft));\n}\n\n.nav-title:focus-visible {\n outline: 2px solid var(--ty-calendar-nav-focus-outline, var(--ty-calendar-accent, var(--ty-color-primary)));\n outline-offset: 2px;\n}\n\n.nav-title-month {\n font-weight: 600;\n letter-spacing: -0.01em;\n color: var(--ty-calendar-nav-title-color, var(--ty-text-strong, var(--ty-color-neutral-strong)));\n}\n\n.nav-title-year {\n font-weight: 400;\n color: var(--ty-calendar-nav-year-color, var(--ty-text-soft, var(--ty-color-neutral)));\n}\n\n.nav-caret {\n display: inline-flex;\n color: var(--ty-calendar-nav-color, var(--ty-color-neutral));\n transition: transform 0.15s ease;\n}\n\n.nav-caret svg {\n width: 1em;\n height: 1em;\n display: block;\n}\n\n.nav-title[aria-expanded=\"true\"] .nav-caret {\n transform: rotate(180deg);\n}\n\n.nav-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--nav-btn-size);\n height: var(--nav-btn-size);\n padding: 0;\n border: 1px solid var(--ty-calendar-nav-border, var(--ty-border));\n border-radius: var(--ty-radius-base);\n background-color: transparent;\n color: var(--ty-calendar-nav-color, var(--ty-color-neutral-strong));\n cursor: pointer;\n transition: var(--ty-local-transition, all 0.15s ease);\n outline: none;\n}\n\n.nav-btn:hover {\n background-color: var(--ty-calendar-nav-hover-bg, var(--ty-bg-neutral-soft));\n color: var(--ty-calendar-nav-hover-color, var(--ty-color-neutral-strong));\n}\n\n.nav-btn:active {\n background-color: var(--ty-calendar-nav-active-bg, var(--ty-bg-neutral));\n transform: scale(0.95);\n}\n\n.nav-btn:disabled {\n opacity: 0.35;\n cursor: default;\n pointer-events: none;\n}\n\n.nav-btn:focus-visible {\n outline: 2px solid var(--ty-calendar-nav-focus-outline, var(--ty-calendar-accent, var(--ty-color-primary)));\n outline-offset: 2px;\n}\n\n.nav-btn svg {\n width: var(--nav-btn-icon-size);\n height: var(--nav-btn-icon-size);\n display: block;\n}\n";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export const calendarNavigationStyles = `
|
|
2
2
|
:host([data-size="md"]) {
|
|
3
|
-
--nav-btn-size:
|
|
4
|
-
--nav-btn-icon-size: 1.
|
|
5
|
-
--nav-font-size:
|
|
3
|
+
--nav-btn-size: 1.875rem;
|
|
4
|
+
--nav-btn-icon-size: 1.125rem;
|
|
5
|
+
--nav-font-size: 1rem;
|
|
6
6
|
--nav-padding: 0.5rem 0.75rem;
|
|
7
7
|
--nav-default-width: 280px;
|
|
8
8
|
}
|
|
9
9
|
:host([data-size="sm"]) {
|
|
10
10
|
--nav-btn-size: 1.5rem;
|
|
11
|
-
--nav-btn-icon-size:
|
|
11
|
+
--nav-btn-icon-size: 0.9375rem;
|
|
12
12
|
--nav-font-size: 0.875rem;
|
|
13
13
|
--nav-padding: 0.375rem 0.5rem;
|
|
14
14
|
--nav-default-width: 240px;
|
|
15
15
|
}
|
|
16
16
|
:host([data-size="lg"]) {
|
|
17
|
-
--nav-btn-size: 2.
|
|
18
|
-
--nav-btn-icon-size: 1.
|
|
19
|
-
--nav-font-size:
|
|
17
|
+
--nav-btn-size: 2.25rem;
|
|
18
|
+
--nav-btn-icon-size: 1.25rem;
|
|
19
|
+
--nav-font-size: 1.125rem;
|
|
20
20
|
--nav-padding: 0.625rem 1rem;
|
|
21
21
|
--nav-default-width: 360px;
|
|
22
22
|
}
|
|
@@ -34,15 +34,55 @@ box-sizing: border-box;
|
|
|
34
34
|
display: flex;
|
|
35
35
|
align-items: center;
|
|
36
36
|
gap: 0.25rem;
|
|
37
|
-
}
|
|
38
|
-
.nav-group-left,
|
|
39
|
-
.nav-group-right {
|
|
40
37
|
flex: 0 0 auto;
|
|
41
38
|
}
|
|
42
|
-
.nav-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
.nav-title {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 0.375rem;
|
|
45
43
|
min-width: 0;
|
|
44
|
+
margin-left: -0.375rem;
|
|
45
|
+
padding: 0.25rem 0.375rem;
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: var(--ty-radius-base);
|
|
48
|
+
background: transparent;
|
|
49
|
+
font-family: inherit;
|
|
50
|
+
font-size: var(--nav-font-size);
|
|
51
|
+
line-height: 1.2;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
transition: var(--ty-local-transition, background-color 0.15s ease);
|
|
55
|
+
outline: none;
|
|
56
|
+
}
|
|
57
|
+
.nav-title:hover,
|
|
58
|
+
.nav-title[aria-expanded="true"] {
|
|
59
|
+
background-color: var(--ty-calendar-nav-hover-bg, var(--ty-bg-neutral-soft));
|
|
60
|
+
}
|
|
61
|
+
.nav-title:focus-visible {
|
|
62
|
+
outline: 2px solid var(--ty-calendar-nav-focus-outline, var(--ty-calendar-accent, var(--ty-color-primary)));
|
|
63
|
+
outline-offset: 2px;
|
|
64
|
+
}
|
|
65
|
+
.nav-title-month {
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
letter-spacing: -0.01em;
|
|
68
|
+
color: var(--ty-calendar-nav-title-color, var(--ty-text-strong, var(--ty-color-neutral-strong)));
|
|
69
|
+
}
|
|
70
|
+
.nav-title-year {
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
color: var(--ty-calendar-nav-year-color, var(--ty-text-soft, var(--ty-color-neutral)));
|
|
73
|
+
}
|
|
74
|
+
.nav-caret {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
color: var(--ty-calendar-nav-color, var(--ty-color-neutral));
|
|
77
|
+
transition: transform 0.15s ease;
|
|
78
|
+
}
|
|
79
|
+
.nav-caret svg {
|
|
80
|
+
width: 1em;
|
|
81
|
+
height: 1em;
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
.nav-title[aria-expanded="true"] .nav-caret {
|
|
85
|
+
transform: rotate(180deg);
|
|
46
86
|
}
|
|
47
87
|
.nav-btn {
|
|
48
88
|
display: inline-flex;
|
|
@@ -51,10 +91,10 @@ justify-content: center;
|
|
|
51
91
|
width: var(--nav-btn-size);
|
|
52
92
|
height: var(--nav-btn-size);
|
|
53
93
|
padding: 0;
|
|
54
|
-
border:
|
|
94
|
+
border: 1px solid var(--ty-calendar-nav-border, var(--ty-border));
|
|
55
95
|
border-radius: var(--ty-radius-base);
|
|
56
96
|
background-color: transparent;
|
|
57
|
-
color: var(--ty-calendar-nav-color, var(--ty-color-neutral));
|
|
97
|
+
color: var(--ty-calendar-nav-color, var(--ty-color-neutral-strong));
|
|
58
98
|
cursor: pointer;
|
|
59
99
|
transition: var(--ty-local-transition, all 0.15s ease);
|
|
60
100
|
outline: none;
|
|
@@ -81,15 +121,4 @@ width: var(--nav-btn-icon-size);
|
|
|
81
121
|
height: var(--nav-btn-icon-size);
|
|
82
122
|
display: block;
|
|
83
123
|
}
|
|
84
|
-
.month-year-display {
|
|
85
|
-
font-size: var(--nav-font-size);
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
color: var(--ty-calendar-nav-title-color, var(--ty-color-neutral-strong));
|
|
88
|
-
text-align: center;
|
|
89
|
-
white-space: nowrap;
|
|
90
|
-
text-transform: uppercase;
|
|
91
|
-
letter-spacing: 0.04em;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
text-overflow: ellipsis;
|
|
94
|
-
}
|
|
95
124
|
`;
|
package/lib/styles/calendar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Calendar Orchestration Styles
|
|
3
|
-
*
|
|
3
|
+
* Container for navigation + month display, plus the month/year grid
|
|
4
|
+
* ty-calendar shows in place of the day grid.
|
|
4
5
|
*/
|
|
5
|
-
export declare const calendarStyles
|
|
6
|
+
export declare const calendarStyles: string;
|
package/lib/styles/calendar.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { calendarMonthFlavorCss } from './calendar-month.js';
|
|
2
|
+
const selectedBg = 'var(--ty-calendar-selected-bg, var(--ty-calendar-accent, var(--calendar-month-selected-bg, var(--ty-solid-primary, var(--ty-color-primary)))))';
|
|
3
|
+
const selectedFg = 'var(--ty-calendar-selected-color, var(--calendar-month-selected-color, var(--ty-solid-primary-fg, white)))';
|
|
1
4
|
export const calendarStyles = `
|
|
2
5
|
.calendar-container {
|
|
3
6
|
display: flex;
|
|
@@ -7,9 +10,83 @@ box-sizing: border-box;
|
|
|
7
10
|
font-family: inherit;
|
|
8
11
|
align-items: center;
|
|
9
12
|
}
|
|
13
|
+
.calendar-container:focus {
|
|
14
|
+
outline: none;
|
|
15
|
+
}
|
|
10
16
|
@media (max-width: 320px) {
|
|
11
17
|
.calendar-container {
|
|
12
18
|
gap: 0.375rem;
|
|
13
19
|
}
|
|
14
20
|
}
|
|
21
|
+
.month-grid {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: repeat(3, 1fr);
|
|
24
|
+
grid-auto-rows: 1fr;
|
|
25
|
+
gap: 0.375rem;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
padding: 0.75rem;
|
|
28
|
+
min-width: 280px;
|
|
29
|
+
width: var(--calendar-width, auto);
|
|
30
|
+
}
|
|
31
|
+
.month-grid.size-sm { padding: 0.5rem; min-width: 240px; gap: 0.25rem; }
|
|
32
|
+
.month-grid.size-lg { padding: 1rem; min-width: 360px; gap: 0.5rem; }
|
|
33
|
+
.month-cell {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
min-height: 2.5rem;
|
|
39
|
+
padding: 0;
|
|
40
|
+
border: none;
|
|
41
|
+
border-radius: var(--ty-calendar-day-radius, 0.5rem);
|
|
42
|
+
background: transparent;
|
|
43
|
+
color: var(--ty-calendar-day-color, var(--ty-text));
|
|
44
|
+
font-family: inherit;
|
|
45
|
+
font-size: 0.875rem;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
outline: none;
|
|
48
|
+
transition: var(--ty-local-transition, background-color 0.15s ease, color 0.15s ease);
|
|
49
|
+
}
|
|
50
|
+
.month-grid.size-sm .month-cell { font-size: 0.75rem; min-height: 2rem; }
|
|
51
|
+
.month-grid.size-lg .month-cell { font-size: 1rem; min-height: 3rem; }
|
|
52
|
+
.month-cell:hover {
|
|
53
|
+
color: var(--ty-calendar-day-hover-color, var(--ty-text-strong));
|
|
54
|
+
background-color: var(--ty-calendar-day-hover-bg, var(--ty-bg-neutral));
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
}
|
|
57
|
+
.month-cell:focus-visible {
|
|
58
|
+
box-shadow: 0 0 0 2px var(--calendar-month-accent, var(--ty-color-primary));
|
|
59
|
+
}
|
|
60
|
+
.month-cell.current {
|
|
61
|
+
color: var(--ty-calendar-today-color, var(--ty-calendar-today-accent, var(--calendar-month-accent, var(--ty-color-primary))));
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
}
|
|
64
|
+
.month-cell.current::after {
|
|
65
|
+
content: "";
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: calc(50% + 0.72em);
|
|
68
|
+
left: 50%;
|
|
69
|
+
width: 4px;
|
|
70
|
+
height: 4px;
|
|
71
|
+
margin-left: -2px;
|
|
72
|
+
border-radius: 50%;
|
|
73
|
+
background: currentColor;
|
|
74
|
+
}
|
|
75
|
+
.month-cell.selected {
|
|
76
|
+
background-color: ${selectedBg};
|
|
77
|
+
color: ${selectedFg};
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
}
|
|
80
|
+
.month-cell.selected:hover {
|
|
81
|
+
background-color: var(--ty-calendar-selected-hover-bg, var(--calendar-month-selected-hover-bg, color-mix(in oklab, ${selectedBg} 85%, ${selectedFg})));
|
|
82
|
+
}
|
|
83
|
+
.month-cell:disabled {
|
|
84
|
+
color: var(--ty-calendar-disabled-color, var(--ty-text-faint));
|
|
85
|
+
opacity: var(--ty-calendar-disabled-opacity, 0.7);
|
|
86
|
+
text-decoration: line-through;
|
|
87
|
+
text-decoration-color: color-mix(in oklab, currentColor 60%, transparent);
|
|
88
|
+
cursor: default;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
${calendarMonthFlavorCss}
|
|
15
92
|
`;
|
package/lib/styles/checkbox.js
CHANGED
|
@@ -4,9 +4,9 @@ const tok = (s) => fb
|
|
|
4
4
|
? `var(--ty-color-${f}${s}, var(--ty-color-${fb}${s}))`
|
|
5
5
|
: `var(--ty-color-${f}${s})`;
|
|
6
6
|
return `
|
|
7
|
-
:host([flavor="${f}"]) { --checkbox-color: ${tok("
|
|
8
|
-
:host([flavor="${f}+"]) { --checkbox-color: ${tok("-strong")}; --checkbox-
|
|
9
|
-
:host([flavor="${f}-"]) { --checkbox-color: ${tok("
|
|
7
|
+
:host([flavor="${f}"]) { --checkbox-color: ${tok("-strong")}; --checkbox-ring: color-mix(in oklab, ${tok("")} 25%, transparent); }
|
|
8
|
+
:host([flavor="${f}+"]) { --checkbox-color: ${tok("-strong")}; --checkbox-ring: color-mix(in oklab, ${tok("-strong")} 25%, transparent); }
|
|
9
|
+
:host([flavor="${f}-"]) { --checkbox-color: ${tok("")}; --checkbox-ring: color-mix(in oklab, ${tok("")} 25%, transparent); }
|
|
10
10
|
`;
|
|
11
11
|
};
|
|
12
12
|
export const checkboxCustomFlavorCss = (base) => checkboxFlavor(base, "neutral");
|
|
@@ -14,24 +14,42 @@ export const checkboxStyles = `
|
|
|
14
14
|
:host {
|
|
15
15
|
display: inline-flex;
|
|
16
16
|
width: auto;
|
|
17
|
-
|
|
17
|
+
height: 1.25em;
|
|
18
|
+
height: 1lh;
|
|
19
|
+
align-items: center;
|
|
20
|
+
vertical-align: baseline;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
}
|
|
23
|
+
:host::before {
|
|
24
|
+
content: "\\200b";
|
|
25
|
+
width: 0;
|
|
18
26
|
}
|
|
19
27
|
.checkbox-container {
|
|
20
28
|
display: inline-flex;
|
|
29
|
+
flex-shrink: 0;
|
|
21
30
|
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
22
32
|
outline: none;
|
|
23
33
|
transition: var(--ty-local-transition, all 0.15s ease-in-out);
|
|
24
34
|
user-select: none;
|
|
25
35
|
cursor: pointer;
|
|
26
36
|
border-radius: 6px;
|
|
27
37
|
gap: var(--ty-spacing-1);
|
|
28
|
-
color: var(--checkbox-color-off, var(--ty-
|
|
38
|
+
color: var(--checkbox-color-off, color-mix(in oklab, var(--ty-text) 30%, transparent));
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
padding: 2px;
|
|
41
|
+
border-radius: 5px;
|
|
42
|
+
}
|
|
43
|
+
.checkbox-container:hover {
|
|
44
|
+
background: var(--checkbox-hover-bg, color-mix(in oklab, var(--ty-text) 8%, transparent));
|
|
45
|
+
}
|
|
46
|
+
.checkbox-container:not([aria-checked="true"]):not([aria-checked="mixed"]):hover {
|
|
47
|
+
color: var(--checkbox-color-off-hover, color-mix(in oklab, var(--ty-text) 50%, transparent));
|
|
29
48
|
}
|
|
30
49
|
.checkbox-container[aria-checked="true"] {
|
|
31
|
-
color: var(--checkbox-color, var(--ty-
|
|
50
|
+
color: var(--checkbox-color, var(--ty-text));
|
|
32
51
|
}
|
|
33
|
-
.checkbox-container.focused
|
|
34
|
-
.checkbox-container:focus-visible {
|
|
52
|
+
.checkbox-container.focused {
|
|
35
53
|
box-shadow: 0 0 0 3px var(--checkbox-ring, color-mix(in oklab, var(--ty-color-primary) 25%, transparent));
|
|
36
54
|
}
|
|
37
55
|
.checkbox-icon {
|
|
@@ -63,11 +81,8 @@ width: 24px;
|
|
|
63
81
|
height: 24px;
|
|
64
82
|
}
|
|
65
83
|
${FLAVORS.map((f) => checkboxFlavor(f)).join("")}
|
|
66
|
-
.checkbox-container:not([aria-checked="true"]) {
|
|
67
|
-
opacity: 0.35;
|
|
68
|
-
}
|
|
69
84
|
.checkbox-container[aria-checked="mixed"] {
|
|
70
|
-
|
|
85
|
+
color: var(--checkbox-color, var(--ty-text));
|
|
71
86
|
}
|
|
72
87
|
.checkbox-container.disabled {
|
|
73
88
|
pointer-events: none;
|
|
@@ -76,7 +91,10 @@ opacity: 0.5;
|
|
|
76
91
|
filter: grayscale(1);
|
|
77
92
|
}
|
|
78
93
|
.checkbox-container.disabled:not([aria-checked="true"]) {
|
|
79
|
-
opacity: 0.
|
|
94
|
+
opacity: 0.45;
|
|
95
|
+
}
|
|
96
|
+
.checkbox-container.disabled:hover {
|
|
97
|
+
background: none;
|
|
80
98
|
}
|
|
81
99
|
.checkbox-container.error .checkbox-icon {
|
|
82
100
|
color: var(--ty-color-danger);
|
package/lib/styles/copy.js
CHANGED
|
@@ -27,9 +27,13 @@ padding: 0;
|
|
|
27
27
|
margin: 0;
|
|
28
28
|
background: transparent;
|
|
29
29
|
border: none;
|
|
30
|
-
color:
|
|
30
|
+
color: var(--input-color, var(--ty-input-color));
|
|
31
31
|
font-family: inherit;
|
|
32
32
|
}
|
|
33
|
+
code.copy-field-value {
|
|
34
|
+
font-family: var(--ty-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
35
|
+
font-size: calc(var(--ty-field-font) * 0.93);
|
|
36
|
+
}
|
|
33
37
|
.copy-field-value.multiline {
|
|
34
38
|
white-space: pre-wrap;
|
|
35
39
|
word-break: break-word;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FLAVORS } from "../types/common.js";
|
|
2
2
|
import { fieldSizeVars } from "./field-size.js";
|
|
3
|
-
const datePickerFlavor = (f, fb) => {
|
|
3
|
+
const datePickerFlavor = (f, fb, also = "") => {
|
|
4
4
|
const c = (s) => fb
|
|
5
5
|
? s
|
|
6
6
|
? `var(--ty-color-${f}${s}, var(--ty-color-${f}, var(--ty-color-${fb}${s})))`
|
|
@@ -9,7 +9,7 @@ const c = (s) => fb
|
|
|
9
9
|
? `var(--ty-color-${f}${s}, var(--ty-color-${f}))`
|
|
10
10
|
: `var(--ty-color-${f})`;
|
|
11
11
|
return `
|
|
12
|
-
:host([flavor="${f}"]) {
|
|
12
|
+
:host([flavor="${f}"])${also} {
|
|
13
13
|
--date-picker-accent: var(--ty-input-${f}-border, ${c("-soft")});
|
|
14
14
|
--date-picker-accent-bold: ${c("")};
|
|
15
15
|
--date-picker-ring: color-mix(in oklab, ${c("")} 15%, transparent);
|
|
@@ -26,6 +26,7 @@ return `
|
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
};
|
|
29
|
+
const errorLook = `,\n:host([error]:not([error=""]))`;
|
|
29
30
|
export const datePickerCustomFlavorCss = (base) => datePickerFlavor(base, "neutral");
|
|
30
31
|
export const datePickerStyles = `
|
|
31
32
|
${fieldSizeVars}
|
|
@@ -92,7 +93,7 @@ align-items: center;
|
|
|
92
93
|
justify-content: center;
|
|
93
94
|
flex-shrink: 0;
|
|
94
95
|
margin-right: 0.5rem;
|
|
95
|
-
color: var(--ty-
|
|
96
|
+
color: var(--ty-text-soft);
|
|
96
97
|
}
|
|
97
98
|
.date-picker-stub ::slotted(ty-icon[slot="start"]) {
|
|
98
99
|
width: 1em;
|
|
@@ -133,7 +134,18 @@ opacity: 0.6;
|
|
|
133
134
|
border-color: var(--date-picker-accent-bold, var(--ty-date-picker-border-focus));
|
|
134
135
|
box-shadow: 0 0 0 3px var(--date-picker-ring, var(--ty-date-picker-shadow-focus));
|
|
135
136
|
}
|
|
136
|
-
${FLAVORS.filter((f) => f !== "neutral").map((f) => datePickerFlavor(f)).join("")}
|
|
137
|
+
${FLAVORS.filter((f) => f !== "neutral").map((f) => datePickerFlavor(f, undefined, f === "danger" ? errorLook : "")).join("")}
|
|
138
|
+
.error-message {
|
|
139
|
+
font-size: var(--ty-font-xs);
|
|
140
|
+
line-height: var(--ty-leading-xs);
|
|
141
|
+
letter-spacing: var(--ty-tracking-xs);
|
|
142
|
+
color: var(--ty-color-danger);
|
|
143
|
+
margin-top: 4px;
|
|
144
|
+
padding-left: var(--ty-field-outer-pad-x);
|
|
145
|
+
}
|
|
146
|
+
.date-picker-stub.error:not([disabled]) {
|
|
147
|
+
background: var(--ty-bg-danger-soft);
|
|
148
|
+
}
|
|
137
149
|
.stub-text {
|
|
138
150
|
flex: 1;
|
|
139
151
|
white-space: nowrap;
|
|
@@ -277,50 +289,80 @@ cursor: pointer;
|
|
|
277
289
|
}
|
|
278
290
|
.time-section {
|
|
279
291
|
display: flex;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
justify-content: center;
|
|
283
|
-
gap: 0.5rem;
|
|
284
|
-
padding: 0.5rem 1rem;
|
|
285
|
-
border-top: 1px solid var(--ty-calendar-time-border);
|
|
286
|
-
background-color: var(--ty-calendar-time-bg);
|
|
292
|
+
flex-direction: column;
|
|
293
|
+
gap: 0.375rem;
|
|
287
294
|
width: 100%;
|
|
288
295
|
box-sizing: border-box;
|
|
289
|
-
|
|
296
|
+
padding: 0.75rem 1rem 0.875rem;
|
|
297
|
+
border-top: 1px solid var(--ty-calendar-time-border);
|
|
298
|
+
background-color: var(--ty-calendar-time-bg);
|
|
299
|
+
}
|
|
300
|
+
.time-row {
|
|
301
|
+
display: flex;
|
|
302
|
+
align-items: center;
|
|
303
|
+
justify-content: space-between;
|
|
304
|
+
gap: 0.75rem;
|
|
290
305
|
}
|
|
291
306
|
.time-label {
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: 0.5rem;
|
|
292
310
|
font-size: var(--ty-font-sm);
|
|
293
311
|
font-weight: 500;
|
|
294
312
|
color: var(--ty-calendar-time-label-color);
|
|
295
|
-
|
|
313
|
+
}
|
|
314
|
+
.time-icon {
|
|
315
|
+
display: flex;
|
|
316
|
+
color: var(--ty-calendar-time-icon-color);
|
|
317
|
+
width: 1rem;
|
|
318
|
+
height: 1rem;
|
|
319
|
+
}
|
|
320
|
+
.time-fields {
|
|
321
|
+
display: inline-flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 0.25rem;
|
|
324
|
+
}
|
|
325
|
+
.time-colon {
|
|
326
|
+
font-weight: 600;
|
|
327
|
+
color: var(--ty-calendar-time-label-color);
|
|
296
328
|
}
|
|
297
329
|
.time-input {
|
|
298
|
-
width:
|
|
330
|
+
width: 2.75rem;
|
|
331
|
+
height: 2.125rem;
|
|
332
|
+
box-sizing: border-box;
|
|
299
333
|
border: 1px solid var(--ty-input-border);
|
|
300
|
-
border-radius: var(--ty-radius-
|
|
334
|
+
border-radius: var(--ty-radius-md, 0.5rem);
|
|
301
335
|
background: var(--ty-input-bg);
|
|
302
336
|
color: var(--ty-calendar-time-input-color);
|
|
303
337
|
font-family: inherit;
|
|
304
|
-
font-size: var(--ty-font-
|
|
338
|
+
font-size: var(--ty-font-base, 0.9375rem);
|
|
339
|
+
font-weight: 500;
|
|
305
340
|
font-variant-numeric: tabular-nums;
|
|
306
341
|
text-align: center;
|
|
307
|
-
padding: 0
|
|
342
|
+
padding: 0;
|
|
308
343
|
outline: none;
|
|
344
|
+
caret-color: transparent;
|
|
309
345
|
transition: var(--ty-transition-all);
|
|
310
346
|
}
|
|
347
|
+
.time-input::selection {
|
|
348
|
+
background: var(--ty-bg-primary-soft, var(--ty-bg-primary));
|
|
349
|
+
}
|
|
350
|
+
.time-input:hover {
|
|
351
|
+
border-color: var(--ty-input-border-hover, var(--ty-input-border));
|
|
352
|
+
}
|
|
311
353
|
.time-input:focus {
|
|
312
354
|
border-color: var(--ty-input-border-focus);
|
|
313
355
|
box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
|
|
314
356
|
}
|
|
315
|
-
.time-
|
|
316
|
-
color: var(--ty-calendar-time-placeholder-color);
|
|
317
|
-
}
|
|
318
|
-
.time-icon {
|
|
357
|
+
.time-summary {
|
|
319
358
|
display: flex;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
359
|
+
justify-content: space-between;
|
|
360
|
+
gap: 0.75rem;
|
|
361
|
+
font-size: var(--ty-font-xs, 0.75rem);
|
|
362
|
+
color: var(--ty-calendar-time-label-color);
|
|
363
|
+
}
|
|
364
|
+
.time-summary-iso {
|
|
365
|
+
font-family: var(--ty-font-mono, ui-monospace, SFMono-Regular, monospace);
|
|
366
|
+
color: var(--ty-calendar-time-placeholder-color);
|
|
325
367
|
}
|
|
326
368
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const fileUploadStyles = "\n:host {\n display: block;\n font-family: inherit;\n width: 100%;\n}\n\n.file-upload-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n box-sizing: border-box;\n}\n\n.upload-label {\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n letter-spacing: var(--ty-tracking-sm);\n font-weight: var(--ty-font-medium);\n color: var(--ty-label-color);\n margin-bottom: 6px;\n padding-left: 4px;\n display: flex;\n align-items: center;\n}\n\n.required-icon {\n color: var(--ty-color-danger);\n margin-left: 4px;\n font-size: 0.75rem;\n line-height: 1;\n}\n\n.drop-zone {\n border: 2px dashed var(--ty-border);\n border-radius: var(--ty-radius-base);\n padding: 2rem 1.5rem;\n text-align: center;\n cursor: pointer;\n transition: var(--ty-local-transition, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease);\n outline: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n min-height: 140px;\n user-select: none;\n}\n\n.drop-zone:hover:not(.disabled) {\n border-color: var(--ty-input-border-hover);\n background: var(--ty-surface-content);\n}\n\n.drop-zone.focused {\n border-color: var(--ty-input-border-focus);\n box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);\n}\n\n.drop-zone.drag-active {\n border-color: var(--ty-color-primary);\n border-style: solid;\n background: var(--ty-bg-primary-);\n}\n\n.drop-zone.drag-active .upload-icon {\n color: var(--ty-color-primary);\n transform: translateY(-2px);\n}\n\n.drop-zone.has-files {\n min-height: 80px;\n padding: 1.25rem 1.5rem;\n}\n\n.drop-zone.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.drop-zone.error {\n border-color: var(--ty-color-danger);\n}\n\n.drop-zone.error:not(.disabled) {\n background: var(--ty-bg-danger-);\n}\n\n.upload-icon {\n color: var(--ty-text-faint);\n width: 2.5rem;\n height: 2.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: var(--ty-local-transition, color 0.15s ease, transform 0.15s ease);\n pointer-events: none;\n}\n\n.upload-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.upload-hint {\n color: var(--ty-text-soft);\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n pointer-events: none;\n}\n\n.browse-link {\n color: var(--ty-color-primary);\n font-weight: var(--ty-font-medium);\n}\n\n.upload-sub-hint {\n color: var(--ty-text-faint);\n font-size: var(--ty-font-xs);\n line-height: var(--ty-leading-xs);\n pointer-events: none;\n}\n\n.file-list {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n margin-top: 0.5rem;\n}\n\n.file-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n border-radius: var(--ty-radius-base);\n background: var(--ty-surface-content);\n border: 1px solid var(--ty-border-soft);\n}\n\n.file-icon {\n color: var(--ty-text-faint);\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n display: flex;\n align-items: center;\n}\n\n.file-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.file-name {\n flex: 1;\n font-size: var(--ty-font-sm);\n color: var(--ty-text);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.file-size {\n font-size: var(--ty-font-xs);\n color: var(--ty-text-faint);\n flex-shrink: 0;\n font-variant-numeric: tabular-nums;\n}\n\n.file-remove {\n flex-shrink: 0;\n cursor: pointer;\n color: var(--ty-text-faint);\n width: 1.25rem;\n height: 1.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: var(--ty-local-transition, color 0.15s ease, background-color 0.15s ease);\n border: none;\n background: none;\n padding: 0;\n outline: none;\n}\n\n.file-remove:hover {\n color: var(--ty-color-danger);\n background: var(--ty-bg-danger-);\n}\n\n.file-remove:focus-visible {\n box-shadow: 0 0 0 2px var(--ty-color-danger);\n}\n\n.file-remove svg {\n width: 12px;\n height: 12px;\n}\n\n.error-message {\n font-size: var(--ty-font-xs);\n line-height: var(--ty-leading-xs);\n color: var(--ty-color-danger);\n margin-top: 4px;\n padding-left: 4px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .drop-zone,\n .upload-icon,\n .file-remove {\n transition: none;\n }\n}\n\n@media (prefers-contrast: high) {\n .drop-zone {\n border-width: 3px;\n }\n}\n";
|
|
1
|
+
export declare const fileUploadStyles = "\n:host {\n display: block;\n font-family: inherit;\n width: 100%;\n}\n\n.file-upload-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n box-sizing: border-box;\n}\n\n.upload-label {\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n letter-spacing: var(--ty-tracking-sm);\n font-weight: var(--ty-font-medium);\n color: var(--ty-label-color);\n margin-bottom: 6px;\n padding-left: 4px;\n display: flex;\n align-items: center;\n}\n\n.required-icon {\n color: var(--ty-color-danger);\n margin-left: 4px;\n font-size: 0.75rem;\n line-height: 1;\n}\n\n.drop-zone {\n border: 2px dashed var(--ty-border);\n border-radius: var(--ty-radius-base);\n padding: 2rem 1.5rem;\n text-align: center;\n cursor: pointer;\n transition: var(--ty-local-transition, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease);\n outline: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n min-height: 140px;\n user-select: none;\n}\n\n.drop-zone:hover:not(.disabled) {\n border-color: var(--ty-input-border-hover);\n background: var(--ty-surface-content);\n}\n\n.drop-zone.focused {\n border-color: var(--ty-input-border-focus);\n box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);\n}\n\n.drop-zone.drag-active {\n border-color: var(--ty-color-primary);\n border-style: solid;\n background: var(--ty-bg-primary-soft);\n}\n\n.drop-zone.drag-active .upload-icon {\n color: var(--ty-color-primary);\n transform: translateY(-2px);\n}\n\n.drop-zone.has-files {\n min-height: 80px;\n padding: 1.25rem 1.5rem;\n}\n\n.drop-zone.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.drop-zone.error {\n border-color: var(--ty-color-danger);\n}\n\n.drop-zone.error:not(.disabled) {\n background: var(--ty-bg-danger-soft);\n}\n\n.upload-icon {\n color: var(--ty-text-faint);\n width: 2.5rem;\n height: 2.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: var(--ty-local-transition, color 0.15s ease, transform 0.15s ease);\n pointer-events: none;\n}\n\n.upload-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.upload-hint {\n color: var(--ty-text-soft);\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n pointer-events: none;\n}\n\n.browse-link {\n color: var(--ty-color-primary);\n font-weight: var(--ty-font-medium);\n}\n\n.upload-sub-hint {\n color: var(--ty-text-faint);\n font-size: var(--ty-font-xs);\n line-height: var(--ty-leading-xs);\n pointer-events: none;\n}\n\n.file-list {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n margin-top: 0.5rem;\n}\n\n.file-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n border-radius: var(--ty-radius-base);\n background: var(--ty-surface-content);\n border: 1px solid var(--ty-border-soft);\n}\n\n.file-icon {\n color: var(--ty-text-faint);\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n display: flex;\n align-items: center;\n}\n\n.file-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.file-name {\n flex: 1;\n font-size: var(--ty-font-sm);\n color: var(--ty-text);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.file-size {\n font-size: var(--ty-font-xs);\n color: var(--ty-text-faint);\n flex-shrink: 0;\n font-variant-numeric: tabular-nums;\n}\n\n.file-remove {\n flex-shrink: 0;\n cursor: pointer;\n color: var(--ty-text-faint);\n width: 1.25rem;\n height: 1.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: var(--ty-local-transition, color 0.15s ease, background-color 0.15s ease);\n border: none;\n background: none;\n padding: 0;\n outline: none;\n}\n\n.file-remove:hover {\n color: var(--ty-color-danger);\n background: var(--ty-bg-danger-soft);\n}\n\n.file-remove:focus-visible {\n box-shadow: 0 0 0 2px var(--ty-color-danger);\n}\n\n.file-remove svg {\n width: 12px;\n height: 12px;\n}\n\n.error-message {\n font-size: var(--ty-font-xs);\n line-height: var(--ty-leading-xs);\n color: var(--ty-color-danger);\n margin-top: 4px;\n padding-left: 4px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .drop-zone,\n .upload-icon,\n .file-remove {\n transition: none;\n }\n}\n\n@media (prefers-contrast: high) {\n .drop-zone {\n border-width: 3px;\n }\n}\n";
|
|
@@ -54,7 +54,7 @@ box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
|
|
|
54
54
|
.drop-zone.drag-active {
|
|
55
55
|
border-color: var(--ty-color-primary);
|
|
56
56
|
border-style: solid;
|
|
57
|
-
background: var(--ty-bg-primary-);
|
|
57
|
+
background: var(--ty-bg-primary-soft);
|
|
58
58
|
}
|
|
59
59
|
.drop-zone.drag-active .upload-icon {
|
|
60
60
|
color: var(--ty-color-primary);
|
|
@@ -73,7 +73,7 @@ pointer-events: none;
|
|
|
73
73
|
border-color: var(--ty-color-danger);
|
|
74
74
|
}
|
|
75
75
|
.drop-zone.error:not(.disabled) {
|
|
76
|
-
background: var(--ty-bg-danger-);
|
|
76
|
+
background: var(--ty-bg-danger-soft);
|
|
77
77
|
}
|
|
78
78
|
.upload-icon {
|
|
79
79
|
color: var(--ty-text-faint);
|
|
@@ -165,7 +165,7 @@ outline: none;
|
|
|
165
165
|
}
|
|
166
166
|
.file-remove:hover {
|
|
167
167
|
color: var(--ty-color-danger);
|
|
168
|
-
background: var(--ty-bg-danger-);
|
|
168
|
+
background: var(--ty-bg-danger-soft);
|
|
169
169
|
}
|
|
170
170
|
.file-remove:focus-visible {
|
|
171
171
|
box-shadow: 0 0 0 2px var(--ty-color-danger);
|
package/lib/styles/icon.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Icon Component Styles */
|
|
2
|
-
export declare const iconStyles = "\n:host {\n /* Display & Layout - CRITICAL: No containment to prevent paint deferral */\n /* Block-level flex, NOT inline-flex: as an inline box the icon generates a\n line box in its parent, so a shrink-wrapping wrapper (badge, .rounded-full\n chip) inherits the parent's line-height strut and renders taller than wide\n \u2014 a 12px icon in a 24px-line-height badge becomes a 22x34 oval. To place an\n icon inline with text, make the *text wrapper* inline-flex instead. */\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n \n width: var(--ty-icon-size, 1em);\n height: var(--ty-icon-size, 1em);\n \n aspect-ratio: 1 / 1;\n \n \n color: inherit;\n transition: color
|
|
2
|
+
export declare const iconStyles = "\n:host {\n /* Display & Layout - CRITICAL: No containment to prevent paint deferral */\n /* Block-level flex, NOT inline-flex: as an inline box the icon generates a\n line box in its parent, so a shrink-wrapping wrapper (badge, .rounded-full\n chip) inherits the parent's line-height strut and renders taller than wide\n \u2014 a 12px icon in a 24px-line-height badge becomes a 22x34 oval. To place an\n icon inline with text, make the *text wrapper* inline-flex instead. */\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n \n width: var(--ty-icon-size, 1em);\n height: var(--ty-icon-size, 1em);\n \n aspect-ratio: 1 / 1;\n \n \n color: inherit;\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n \n flex-shrink: 0;\n \n /* Visibility - Force immediate rendering */\n visibility: visible !important;\n opacity: 1;\n \n /* ANTI-FLICKER: Force browser to paint immediately */\n will-change: contents;\n \n /* Prevent any sub-pixel rendering issues */\n transform: translateZ(0);\n -webkit-font-smoothing: antialiased;\n}\n\n/* The SVG element inside shadow DOM (registry / fallback path) */\n:host svg {\n width: 100%;\n height: 100%;\n display: block;\n\n /* Force immediate SVG rendering */\n will-change: auto;\n transform: translateZ(0);\n}\n\n/* Slotted SVG (server-side path: <ty-icon><svg>...</svg></ty-icon>).\n ::slotted() targets light-DOM children so they fill the host the same way\n shadow-DOM SVG does. Color is inherited from :host via currentColor. */\n::slotted(svg),\n::slotted(img) {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* In a named slot the icon sits alongside text (button start/end), so inline\n layout is what the host expects there. */\n:host([slot]) {\n display: inline-flex;\n}\n\n:host(.icon-xs) {\n width: 0.75em;\n height: 0.75em;\n}\n\n:host(.icon-sm) {\n width: 0.875em;\n height: 0.875em;\n}\n\n:host(.icon-md) {\n width: 1em;\n height: 1em;\n}\n\n:host(.icon-lg) {\n width: 1.25em;\n height: 1.25em;\n}\n\n:host(.icon-xl) {\n width: 1.5em;\n height: 1.5em;\n}\n\n:host(.icon-2xl) {\n width: 2em;\n height: 2em;\n}\n\n/* Fixed pixel sizes */\n:host(.icon-12) {\n width: 12px;\n height: 12px;\n}\n\n:host(.icon-14) {\n width: 14px;\n height: 14px;\n}\n\n:host(.icon-16) {\n width: 16px;\n height: 16px;\n}\n\n:host(.icon-18) {\n width: 18px;\n height: 18px;\n}\n\n:host(.icon-20) {\n width: 20px;\n height: 20px;\n}\n\n:host(.icon-24) {\n width: 24px;\n height: 24px;\n}\n\n:host(.icon-32) {\n width: 32px;\n height: 32px;\n}\n\n:host(.icon-48) {\n width: 48px;\n height: 48px;\n}\n\n:host(.icon-64) {\n width: 64px;\n height: 64px;\n}\n\n:host(.icon-80) {\n width: 80px;\n height: 80px;\n}\n\n:host(.icon-96) {\n width: 96px;\n height: 96px;\n}\n\n:host(.icon-spin) {\n animation: icon-spin 1s linear infinite;\n}\n\n:host(.icon-spin.icon-tempo-slow) {\n animation: icon-spin 2s linear infinite;\n}\n\n:host(.icon-spin.icon-tempo-fast) {\n animation: icon-spin 0.5s linear infinite;\n}\n\n@keyframes icon-spin {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n}\n\n:host(.icon-pulse) {\n animation: icon-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n:host(.icon-pulse.icon-tempo-slow) {\n animation: icon-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n:host(.icon-pulse.icon-tempo-fast) {\n animation: icon-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n@keyframes icon-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.5;\n }\n}\n\n/* Accessibility: ensure icons are not announced by screen readers by default */\n:host {\n -webkit-user-select: none;\n user-select: none;\n}\n\n:host(:not(.icon-clickable)) {\n pointer-events: none;\n}\n\n:host(.icon-clickable) {\n cursor: pointer;\n pointer-events: auto;\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n:host(.icon-clickable:hover) {\n transform: scale(1.1);\n}\n\n:host(.icon-clickable:active) {\n transform: scale(0.95);\n}\n\n:host(.icon-disabled) {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n:host(.icon-block) {\n display: block;\n}\n";
|
package/lib/styles/icon.js
CHANGED
|
@@ -8,7 +8,7 @@ width: var(--ty-icon-size, 1em);
|
|
|
8
8
|
height: var(--ty-icon-size, 1em);
|
|
9
9
|
aspect-ratio: 1 / 1;
|
|
10
10
|
color: inherit;
|
|
11
|
-
transition: color
|
|
11
|
+
transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
12
12
|
flex-shrink: 0;
|
|
13
13
|
visibility: visible !important;
|
|
14
14
|
opacity: 1;
|
|
@@ -145,7 +145,7 @@ pointer-events: none;
|
|
|
145
145
|
:host(.icon-clickable) {
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
pointer-events: auto;
|
|
148
|
-
transition: color
|
|
148
|
+
transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
149
149
|
}
|
|
150
150
|
:host(.icon-clickable:hover) {
|
|
151
151
|
transform: scale(1.1);
|
package/lib/styles/input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FLAVORS } from "../types/common.js";
|
|
2
2
|
import { fieldSizeVars } from "./field-size.js";
|
|
3
|
-
const inputFlavor = (f, fb) => {
|
|
3
|
+
const inputFlavor = (f, fb, also = "") => {
|
|
4
4
|
const c = (s) => fb
|
|
5
5
|
? s
|
|
6
6
|
? `var(--ty-color-${f}${s}, var(--ty-color-${f}, var(--ty-color-${fb}${s})))`
|
|
@@ -9,7 +9,7 @@ const c = (s) => fb
|
|
|
9
9
|
? `var(--ty-color-${f}${s}, var(--ty-color-${f}))`
|
|
10
10
|
: `var(--ty-color-${f})`;
|
|
11
11
|
return `
|
|
12
|
-
:host([flavor="${f}"]) {
|
|
12
|
+
:host([flavor="${f}"])${also} {
|
|
13
13
|
--input-accent: var(--ty-input-${f}-border, ${c("-soft")});
|
|
14
14
|
--input-accent-bold: ${c("")};
|
|
15
15
|
--input-ring: color-mix(in oklab, ${c("")} 15%, transparent);
|
|
@@ -26,6 +26,7 @@ return `
|
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
};
|
|
29
|
+
const errorLook = `,\n:host([error]:not([error=""]))`;
|
|
29
30
|
export const inputCustomFlavorCss = (base) => inputFlavor(base, "neutral");
|
|
30
31
|
export const inputStyles = `
|
|
31
32
|
${fieldSizeVars}
|
|
@@ -96,7 +97,7 @@ display: flex;
|
|
|
96
97
|
align-items: center;
|
|
97
98
|
justify-content: center;
|
|
98
99
|
flex-shrink: 0;
|
|
99
|
-
color: var(--ty-
|
|
100
|
+
color: var(--ty-text-soft);
|
|
100
101
|
}
|
|
101
102
|
.password-toggle {
|
|
102
103
|
display: flex;
|
|
@@ -137,14 +138,9 @@ color: var(--ty-color-danger);
|
|
|
137
138
|
margin-top: 4px;
|
|
138
139
|
padding-left: var(--ty-field-outer-pad-x);
|
|
139
140
|
}
|
|
140
|
-
.input-wrapper.error {
|
|
141
|
-
border-color: var(--ty-color-danger);
|
|
141
|
+
.input-wrapper.error:not(.disabled) {
|
|
142
142
|
background: var(--ty-bg-danger-soft);
|
|
143
143
|
}
|
|
144
|
-
.input-wrapper.error.focused {
|
|
145
|
-
border-color: var(--ty-color-danger-bold);
|
|
146
|
-
box-shadow: 0 0 0 3px var(--input-shadow-focus, var(--ty-input-shadow-focus));
|
|
147
|
-
}
|
|
148
144
|
input {
|
|
149
145
|
flex: 1;
|
|
150
146
|
min-width: 0;
|
|
@@ -177,7 +173,7 @@ input::placeholder {
|
|
|
177
173
|
color: var(--input-placeholder, var(--ty-input-placeholder));
|
|
178
174
|
font-weight: 400;
|
|
179
175
|
}
|
|
180
|
-
${FLAVORS.filter((f) => f !== "neutral").map((f) => inputFlavor(f)).join("")}
|
|
176
|
+
${FLAVORS.filter((f) => f !== "neutral").map((f) => inputFlavor(f, undefined, f === "danger" ? errorLook : "")).join("")}
|
|
181
177
|
input:focus-visible {
|
|
182
178
|
outline: none;
|
|
183
179
|
}
|