tyrell-components 1.0.0-RC13 → 1.0.0-RC14
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 +1 -1
- package/css/tyrell-theme.css +167 -178
- package/css/tyrell.css +19 -0
- package/dist/tyrell-theme.css +167 -178
- package/dist/tyrell.css +19 -0
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +20 -10
- package/lib/base/ty-component.js +21 -144
- package/lib/components/button.d.ts +2 -16
- package/lib/components/button.js +0 -36
- package/lib/components/calendar-month.d.ts +2 -48
- package/lib/components/calendar-month.js +4 -166
- package/lib/components/calendar-navigation.d.ts +3 -48
- package/lib/components/calendar-navigation.js +3 -126
- package/lib/components/calendar.d.ts +3 -80
- package/lib/components/calendar.js +8 -230
- package/lib/components/checkbox.d.ts +4 -71
- package/lib/components/checkbox.js +7 -151
- package/lib/components/copy.d.ts +3 -56
- package/lib/components/copy.js +1 -120
- package/lib/components/date-picker.d.ts +13 -162
- package/lib/components/date-picker.js +41 -592
- package/lib/components/file-upload.d.ts +9 -15
- package/lib/components/file-upload.js +19 -41
- package/lib/components/icon.d.ts +3 -24
- package/lib/components/icon.js +1 -90
- package/lib/components/input.d.ts +7 -107
- package/lib/components/input.js +5 -193
- package/lib/components/modal.d.ts +17 -26
- package/lib/components/modal.js +57 -201
- package/lib/components/option.d.ts +2 -9
- package/lib/components/option.js +0 -48
- package/lib/components/popup.d.ts +2 -17
- package/lib/components/popup.js +8 -139
- package/lib/components/radio.d.ts +3 -23
- package/lib/components/radio.js +10 -65
- package/lib/components/resize-observer.d.ts +3 -30
- package/lib/components/resize-observer.js +12 -46
- package/lib/components/scroll-container.d.ts +2 -12
- package/lib/components/scroll-container.js +3 -46
- package/lib/components/select.d.ts +22 -153
- package/lib/components/select.js +33 -590
- package/lib/components/selected-tags.d.ts +4 -47
- package/lib/components/selected-tags.js +1 -95
- package/lib/components/step.d.ts +1 -6
- package/lib/components/step.js +0 -6
- package/lib/components/switch.d.ts +0 -11
- package/lib/components/switch.js +2 -36
- package/lib/components/tab.d.ts +1 -6
- package/lib/components/tab.js +0 -7
- package/lib/components/tabs.d.ts +5 -63
- package/lib/components/tabs.js +20 -283
- package/lib/components/tag.d.ts +2 -36
- package/lib/components/tag.js +5 -105
- package/lib/components/textarea.d.ts +6 -86
- package/lib/components/textarea.js +2 -173
- package/lib/components/tooltip.d.ts +3 -11
- package/lib/components/tooltip.js +24 -160
- package/lib/components/wizard.d.ts +6 -54
- package/lib/components/wizard.js +15 -228
- package/lib/icons/fontawesome/brands.d.ts +0 -1
- package/lib/icons/fontawesome/brands.js +0 -8
- package/lib/icons/fontawesome/regular.d.ts +0 -1
- package/lib/icons/fontawesome/regular.js +0 -8
- package/lib/icons/fontawesome/solid.d.ts +0 -1
- package/lib/icons/fontawesome/solid.js +0 -8
- package/lib/icons/heroicons/micro.d.ts +0 -1
- package/lib/icons/heroicons/micro.js +0 -8
- package/lib/icons/heroicons/mini.d.ts +0 -1
- package/lib/icons/heroicons/mini.js +0 -8
- package/lib/icons/heroicons/outline.d.ts +0 -1
- package/lib/icons/heroicons/outline.js +0 -8
- package/lib/icons/heroicons/solid.d.ts +0 -1
- package/lib/icons/heroicons/solid.js +0 -8
- package/lib/icons/lucide.d.ts +0 -1
- package/lib/icons/lucide.js +0 -1872
- package/lib/icons/material/filled.d.ts +0 -1
- package/lib/icons/material/filled.js +0 -10
- package/lib/icons/material/outlined.d.ts +0 -1
- package/lib/icons/material/outlined.js +0 -10
- package/lib/icons/material/round.d.ts +0 -1
- package/lib/icons/material/round.js +0 -10
- package/lib/icons/material/sharp.d.ts +0 -1
- package/lib/icons/material/sharp.js +0 -10
- package/lib/icons/material/two-tone.d.ts +0 -1
- package/lib/icons/material/two-tone.js +0 -10
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -20
- package/lib/styles/button.d.ts +2 -20
- package/lib/styles/button.js +22 -122
- package/lib/styles/calendar-month.d.ts +1 -5
- package/lib/styles/calendar-month.js +4 -61
- package/lib/styles/calendar-navigation.d.ts +2 -6
- package/lib/styles/calendar-navigation.js +2 -27
- package/lib/styles/calendar.d.ts +1 -2
- package/lib/styles/calendar.js +1 -14
- package/lib/styles/checkbox.d.ts +0 -1
- package/lib/styles/checkbox.js +1 -23
- package/lib/styles/copy.d.ts +0 -1
- package/lib/styles/copy.js +2 -17
- package/lib/styles/custom-scrollbar.d.ts +1 -2
- package/lib/styles/custom-scrollbar.js +3 -18
- package/lib/styles/date-picker.d.ts +1 -5
- package/lib/styles/date-picker.js +35 -39
- package/lib/styles/file-upload.d.ts +1 -2
- package/lib/styles/file-upload.js +1 -16
- package/lib/styles/icon.d.ts +2 -6
- package/lib/styles/icon.js +7 -21
- package/lib/styles/input.d.ts +1 -6
- package/lib/styles/input.js +5 -54
- package/lib/styles/modal.d.ts +1 -2
- package/lib/styles/modal.js +21 -23
- package/lib/styles/option.d.ts +2 -6
- package/lib/styles/option.js +17 -12
- package/lib/styles/popup.d.ts +1 -2
- package/lib/styles/popup.js +26 -30
- package/lib/styles/radio.d.ts +0 -1
- package/lib/styles/radio.js +2 -16
- package/lib/styles/resize-observer.d.ts +1 -2
- package/lib/styles/resize-observer.js +0 -7
- package/lib/styles/scroll-container.d.ts +1 -2
- package/lib/styles/scroll-container.js +0 -19
- package/lib/styles/select-base.d.ts +0 -1
- package/lib/styles/select-base.js +68 -79
- package/lib/styles/select.d.ts +1 -2
- package/lib/styles/select.js +7 -15
- package/lib/styles/step.d.ts +1 -2
- package/lib/styles/step.js +0 -4
- package/lib/styles/switch.d.ts +0 -1
- package/lib/styles/switch.js +2 -20
- package/lib/styles/tab.d.ts +1 -2
- package/lib/styles/tab.js +0 -5
- package/lib/styles/tabs.d.ts +3 -11
- package/lib/styles/tabs.js +10 -48
- package/lib/styles/tag.d.ts +1 -5
- package/lib/styles/tag.js +2 -31
- package/lib/styles/textarea.d.ts +1 -2
- package/lib/styles/textarea.js +2 -45
- package/lib/styles/tooltip.d.ts +0 -1
- package/lib/styles/tooltip.js +0 -10
- package/lib/styles/wizard.d.ts +5 -21
- package/lib/styles/wizard.js +8 -88
- package/lib/types/common.d.ts +0 -2
- package/lib/types/common.js +0 -12
- package/lib/utils/calendar-utils.d.ts +4 -21
- package/lib/utils/calendar-utils.js +4 -177
- package/lib/utils/custom-scrollbar.d.ts +6 -20
- package/lib/utils/custom-scrollbar.js +1 -45
- package/lib/utils/flavor-sheet.d.ts +0 -1
- package/lib/utils/flavor-sheet.js +0 -23
- package/lib/utils/icon-registry.d.ts +0 -2
- package/lib/utils/icon-registry.js +1 -107
- package/lib/utils/icons.d.ts +0 -1
- package/lib/utils/icons.js +0 -9
- package/lib/utils/loader-registry.d.ts +0 -1
- package/lib/utils/loader-registry.js +0 -32
- package/lib/utils/locale.d.ts +2 -23
- package/lib/utils/locale.js +0 -86
- package/lib/utils/mobile.d.ts +0 -1
- package/lib/utils/mobile.js +0 -17
- package/lib/utils/number-format.d.ts +6 -3
- package/lib/utils/number-format.js +11 -67
- package/lib/utils/positioning.d.ts +50 -7
- package/lib/utils/positioning.js +52 -62
- package/lib/utils/property-capture.d.ts +5 -27
- package/lib/utils/property-capture.js +0 -108
- package/lib/utils/property-manager.d.ts +0 -1
- package/lib/utils/property-manager.js +0 -70
- package/lib/utils/resize-observer.d.ts +0 -1
- package/lib/utils/resize-observer.js +0 -36
- package/lib/utils/scroll-lock.d.ts +4 -11
- package/lib/utils/scroll-lock.js +0 -107
- package/lib/utils/styles.d.ts +0 -1
- package/lib/utils/styles.js +0 -24
- package/lib/version.d.ts +1 -2
- package/lib/version.js +1 -11
- package/package.json +2 -2
- package/lib/base/ty-component.d.ts.map +0 -1
- package/lib/base/ty-component.js.map +0 -1
- package/lib/components/button.d.ts.map +0 -1
- package/lib/components/button.js.map +0 -1
- package/lib/components/calendar-month.d.ts.map +0 -1
- package/lib/components/calendar-month.js.map +0 -1
- package/lib/components/calendar-navigation.d.ts.map +0 -1
- package/lib/components/calendar-navigation.js.map +0 -1
- package/lib/components/calendar.d.ts.map +0 -1
- package/lib/components/calendar.js.map +0 -1
- package/lib/components/checkbox.d.ts.map +0 -1
- package/lib/components/checkbox.js.map +0 -1
- package/lib/components/copy.d.ts.map +0 -1
- package/lib/components/copy.js.map +0 -1
- package/lib/components/date-picker.d.ts.map +0 -1
- package/lib/components/date-picker.js.map +0 -1
- package/lib/components/file-upload.d.ts.map +0 -1
- package/lib/components/file-upload.js.map +0 -1
- package/lib/components/icon.d.ts.map +0 -1
- package/lib/components/icon.js.map +0 -1
- package/lib/components/input.d.ts.map +0 -1
- package/lib/components/input.js.map +0 -1
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js.map +0 -1
- package/lib/components/option.d.ts.map +0 -1
- package/lib/components/option.js.map +0 -1
- package/lib/components/popup.d.ts.map +0 -1
- package/lib/components/popup.js.map +0 -1
- package/lib/components/radio.d.ts.map +0 -1
- package/lib/components/radio.js.map +0 -1
- package/lib/components/resize-observer.d.ts.map +0 -1
- package/lib/components/resize-observer.js.map +0 -1
- package/lib/components/scroll-container.d.ts.map +0 -1
- package/lib/components/scroll-container.js.map +0 -1
- package/lib/components/select.d.ts.map +0 -1
- package/lib/components/select.js.map +0 -1
- package/lib/components/selected-tags.d.ts.map +0 -1
- package/lib/components/selected-tags.js.map +0 -1
- package/lib/components/step.d.ts.map +0 -1
- package/lib/components/step.js.map +0 -1
- package/lib/components/switch.d.ts.map +0 -1
- package/lib/components/switch.js.map +0 -1
- package/lib/components/tab.d.ts.map +0 -1
- package/lib/components/tab.js.map +0 -1
- package/lib/components/tabs.d.ts.map +0 -1
- package/lib/components/tabs.js.map +0 -1
- package/lib/components/tag.d.ts.map +0 -1
- package/lib/components/tag.js.map +0 -1
- package/lib/components/textarea.d.ts.map +0 -1
- package/lib/components/textarea.js.map +0 -1
- package/lib/components/tooltip.d.ts.map +0 -1
- package/lib/components/tooltip.js.map +0 -1
- package/lib/components/wizard.d.ts.map +0 -1
- package/lib/components/wizard.js.map +0 -1
- package/lib/icons/fontawesome/brands.d.ts.map +0 -1
- package/lib/icons/fontawesome/brands.js.map +0 -1
- package/lib/icons/fontawesome/regular.d.ts.map +0 -1
- package/lib/icons/fontawesome/regular.js.map +0 -1
- package/lib/icons/fontawesome/solid.d.ts.map +0 -1
- package/lib/icons/fontawesome/solid.js.map +0 -1
- package/lib/icons/heroicons/micro.d.ts.map +0 -1
- package/lib/icons/heroicons/micro.js.map +0 -1
- package/lib/icons/heroicons/mini.d.ts.map +0 -1
- package/lib/icons/heroicons/mini.js.map +0 -1
- package/lib/icons/heroicons/outline.d.ts.map +0 -1
- package/lib/icons/heroicons/outline.js.map +0 -1
- package/lib/icons/heroicons/solid.d.ts.map +0 -1
- package/lib/icons/heroicons/solid.js.map +0 -1
- package/lib/icons/lucide.d.ts.map +0 -1
- package/lib/icons/lucide.js.map +0 -1
- package/lib/icons/material/filled.d.ts.map +0 -1
- package/lib/icons/material/filled.js.map +0 -1
- package/lib/icons/material/outlined.d.ts.map +0 -1
- package/lib/icons/material/outlined.js.map +0 -1
- package/lib/icons/material/round.d.ts.map +0 -1
- package/lib/icons/material/round.js.map +0 -1
- package/lib/icons/material/sharp.d.ts.map +0 -1
- package/lib/icons/material/sharp.js.map +0 -1
- package/lib/icons/material/two-tone.d.ts.map +0 -1
- package/lib/icons/material/two-tone.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/styles/button.d.ts.map +0 -1
- package/lib/styles/button.js.map +0 -1
- package/lib/styles/calendar-month.d.ts.map +0 -1
- package/lib/styles/calendar-month.js.map +0 -1
- package/lib/styles/calendar-navigation.d.ts.map +0 -1
- package/lib/styles/calendar-navigation.js.map +0 -1
- package/lib/styles/calendar.d.ts.map +0 -1
- package/lib/styles/calendar.js.map +0 -1
- package/lib/styles/checkbox.d.ts.map +0 -1
- package/lib/styles/checkbox.js.map +0 -1
- package/lib/styles/copy.d.ts.map +0 -1
- package/lib/styles/copy.js.map +0 -1
- package/lib/styles/custom-scrollbar.d.ts.map +0 -1
- package/lib/styles/custom-scrollbar.js.map +0 -1
- package/lib/styles/date-picker.d.ts.map +0 -1
- package/lib/styles/date-picker.js.map +0 -1
- package/lib/styles/file-upload.d.ts.map +0 -1
- package/lib/styles/file-upload.js.map +0 -1
- package/lib/styles/icon.d.ts.map +0 -1
- package/lib/styles/icon.js.map +0 -1
- package/lib/styles/input.d.ts.map +0 -1
- package/lib/styles/input.js.map +0 -1
- package/lib/styles/modal.d.ts.map +0 -1
- package/lib/styles/modal.js.map +0 -1
- package/lib/styles/multiselect.d.ts +0 -8
- package/lib/styles/multiselect.d.ts.map +0 -1
- package/lib/styles/multiselect.js +0 -849
- package/lib/styles/multiselect.js.map +0 -1
- package/lib/styles/option.d.ts.map +0 -1
- package/lib/styles/option.js.map +0 -1
- package/lib/styles/popup.d.ts.map +0 -1
- package/lib/styles/popup.js.map +0 -1
- package/lib/styles/radio.d.ts.map +0 -1
- package/lib/styles/radio.js.map +0 -1
- package/lib/styles/resize-observer.d.ts.map +0 -1
- package/lib/styles/resize-observer.js.map +0 -1
- package/lib/styles/scroll-container.d.ts.map +0 -1
- package/lib/styles/scroll-container.js.map +0 -1
- package/lib/styles/select-base.d.ts.map +0 -1
- package/lib/styles/select-base.js.map +0 -1
- package/lib/styles/select.d.ts.map +0 -1
- package/lib/styles/select.js.map +0 -1
- package/lib/styles/step.d.ts.map +0 -1
- package/lib/styles/step.js.map +0 -1
- package/lib/styles/switch.d.ts.map +0 -1
- package/lib/styles/switch.js.map +0 -1
- package/lib/styles/tab.d.ts.map +0 -1
- package/lib/styles/tab.js.map +0 -1
- package/lib/styles/tabs.d.ts.map +0 -1
- package/lib/styles/tabs.js.map +0 -1
- package/lib/styles/tag.d.ts.map +0 -1
- package/lib/styles/tag.js.map +0 -1
- package/lib/styles/textarea.d.ts.map +0 -1
- package/lib/styles/textarea.js.map +0 -1
- package/lib/styles/tooltip.d.ts.map +0 -1
- package/lib/styles/tooltip.js.map +0 -1
- package/lib/styles/wizard.d.ts.map +0 -1
- package/lib/styles/wizard.js.map +0 -1
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/common.js.map +0 -1
- package/lib/utils/calendar-utils.d.ts.map +0 -1
- package/lib/utils/calendar-utils.js.map +0 -1
- package/lib/utils/custom-scrollbar.d.ts.map +0 -1
- package/lib/utils/custom-scrollbar.js.map +0 -1
- package/lib/utils/flavor-sheet.d.ts.map +0 -1
- package/lib/utils/flavor-sheet.js.map +0 -1
- package/lib/utils/icon-registry.d.ts.map +0 -1
- package/lib/utils/icon-registry.js.map +0 -1
- package/lib/utils/icons.d.ts.map +0 -1
- package/lib/utils/icons.js.map +0 -1
- package/lib/utils/loader-registry.d.ts.map +0 -1
- package/lib/utils/loader-registry.js.map +0 -1
- package/lib/utils/locale.d.ts.map +0 -1
- package/lib/utils/locale.js.map +0 -1
- package/lib/utils/mobile.d.ts.map +0 -1
- package/lib/utils/mobile.js.map +0 -1
- package/lib/utils/number-format.d.ts.map +0 -1
- package/lib/utils/number-format.js.map +0 -1
- package/lib/utils/parse-boolean.d.ts +0 -39
- package/lib/utils/parse-boolean.d.ts.map +0 -1
- package/lib/utils/parse-boolean.js +0 -58
- package/lib/utils/parse-boolean.js.map +0 -1
- package/lib/utils/positioning.d.ts.map +0 -1
- package/lib/utils/positioning.js.map +0 -1
- package/lib/utils/property-capture.d.ts.map +0 -1
- package/lib/utils/property-capture.js.map +0 -1
- package/lib/utils/property-manager.d.ts.map +0 -1
- package/lib/utils/property-manager.js.map +0 -1
- package/lib/utils/resize-observer.d.ts.map +0 -1
- package/lib/utils/resize-observer.js.map +0 -1
- package/lib/utils/scroll-lock.d.ts.map +0 -1
- package/lib/utils/scroll-lock.js.map +0 -1
- package/lib/utils/styles.d.ts.map +0 -1
- package/lib/utils/styles.js.map +0 -1
- package/lib/version.d.ts.map +0 -1
- package/lib/version.js.map +0 -1
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Select Field Styles — shared chrome for ty-select (both single and
|
|
3
|
-
* multiple modes). Formerly split across ty-dropdown / ty-multiselect;
|
|
4
|
-
* those were consolidated into ty-select and this file kept the name.
|
|
5
|
-
*/
|
|
6
1
|
import { FLAVORS } from "../types/common.js";
|
|
7
2
|
import { customScrollbarStyles } from "./custom-scrollbar.js";
|
|
8
|
-
/* Flavor rules only set --select-accent (border), --select-accent-bold
|
|
9
|
-
(hover/open border), and --select-ring (open focus ring); the .select-stub
|
|
10
|
-
rules below consume them. Doubles as the per-instance override API:
|
|
11
|
-
`ty-select { --select-accent: … }`. Neutral is skipped — it IS the default
|
|
12
|
-
unstyled chrome (--ty-input-* tokens), same convention as
|
|
13
|
-
ty-input/ty-date-picker. Fallback flavor `fb` is used for custom flavors
|
|
14
|
-
so missing tokens degrade to neutral. */
|
|
15
3
|
const selectFlavor = (f, fb) => {
|
|
16
4
|
const c = (s) => fb
|
|
17
5
|
? s
|
|
@@ -38,15 +26,12 @@ const selectFlavor = (f, fb) => {
|
|
|
38
26
|
}
|
|
39
27
|
`;
|
|
40
28
|
};
|
|
41
|
-
/** Rules for one custom (non-built-in) flavor — see utils/flavor-sheet.ts. */
|
|
42
29
|
export const selectCustomFlavorCss = (base) => selectFlavor(base, "neutral");
|
|
43
30
|
export const selectBaseStyles = `
|
|
44
|
-
/* Select-field-specific styles extending dropdown base styles */
|
|
45
|
-
|
|
46
31
|
:host {
|
|
47
32
|
display: block;
|
|
48
33
|
width: 100%;
|
|
49
|
-
font-family:
|
|
34
|
+
font-family: inherit;
|
|
50
35
|
--mobile-border-color: var(--ty-border, #5858587d);
|
|
51
36
|
}
|
|
52
37
|
|
|
@@ -59,8 +44,6 @@ export const selectBaseStyles = `
|
|
|
59
44
|
width: auto;
|
|
60
45
|
}
|
|
61
46
|
|
|
62
|
-
/* ===== DIALOG POSITIONING SUPPORT ===== */
|
|
63
|
-
|
|
64
47
|
.dropdown-dialog {
|
|
65
48
|
position: fixed;
|
|
66
49
|
width: var(--dropdown-width, 200px);
|
|
@@ -73,9 +56,18 @@ export const selectBaseStyles = `
|
|
|
73
56
|
padding: var(--dropdown-padding, 20px);
|
|
74
57
|
/* Modal handles z-index automatically */
|
|
75
58
|
|
|
76
|
-
/* Hidden by default */
|
|
77
59
|
opacity: 0;
|
|
78
|
-
|
|
60
|
+
/* Panel-level entrance: individual scale/translate compose with the
|
|
61
|
+
collision-shift transform below. The single-select skin flattens the
|
|
62
|
+
inner .dropdown-options animation (select.ts: "panel appears as one"),
|
|
63
|
+
so the dialog carries the motion for both skins. */
|
|
64
|
+
scale: 0.96;
|
|
65
|
+
translate: 0 -6px;
|
|
66
|
+
transform-origin: top center;
|
|
67
|
+
transition:
|
|
68
|
+
opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
|
|
69
|
+
scale var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
|
|
70
|
+
translate var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
|
|
79
71
|
|
|
80
72
|
transform: translate(var(--dropdown-offset-x, 0px), var(--dropdown-offset-y, 0px));
|
|
81
73
|
top: -1000px;
|
|
@@ -88,7 +80,6 @@ export const selectBaseStyles = `
|
|
|
88
80
|
flex-direction: column;
|
|
89
81
|
}
|
|
90
82
|
|
|
91
|
-
/* Direction-based positioning with CSS classes */
|
|
92
83
|
.dropdown-dialog.position-below {
|
|
93
84
|
left: var(--dropdown-x);
|
|
94
85
|
top: var(--dropdown-y);
|
|
@@ -99,6 +90,8 @@ export const selectBaseStyles = `
|
|
|
99
90
|
bottom: var(--dropdown-y);
|
|
100
91
|
top: auto;
|
|
101
92
|
flex-direction: column-reverse;
|
|
93
|
+
translate: 0 6px;
|
|
94
|
+
transform-origin: bottom center;
|
|
102
95
|
}
|
|
103
96
|
|
|
104
97
|
.dropdown-dialog.position-above .dropdown-header {
|
|
@@ -110,13 +103,18 @@ export const selectBaseStyles = `
|
|
|
110
103
|
}
|
|
111
104
|
|
|
112
105
|
.dropdown-dialog.position-below .dropdown-options {
|
|
113
|
-
/* Optional: Add upward-pointing shadow for below positioning */
|
|
114
106
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1), var(--ty-shadow-md);
|
|
115
107
|
}
|
|
116
108
|
|
|
117
|
-
|
|
109
|
+
.dropdown-dialog.position-above .dropdown-options {
|
|
110
|
+
transform: translateY(6px) scale(0.96);
|
|
111
|
+
transform-origin: bottom center;
|
|
112
|
+
}
|
|
113
|
+
|
|
118
114
|
.dropdown-dialog.open {
|
|
119
115
|
opacity: 1;
|
|
116
|
+
scale: 1;
|
|
117
|
+
translate: 0 0;
|
|
120
118
|
}
|
|
121
119
|
|
|
122
120
|
.dropdown-dialog.open .dropdown-options {
|
|
@@ -124,12 +122,35 @@ export const selectBaseStyles = `
|
|
|
124
122
|
transform: translateY(0) scale(1);
|
|
125
123
|
}
|
|
126
124
|
|
|
125
|
+
/* Transitions never start on an element that was display:none last frame —
|
|
126
|
+
showModal() + .open land in the same frame, so the enter transition was
|
|
127
|
+
silently skipped. @starting-style supplies the first-frame "from" values
|
|
128
|
+
(this is the platform mechanism for animating dialog/top-layer entry). */
|
|
129
|
+
@starting-style {
|
|
130
|
+
.dropdown-dialog.open {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
scale: 0.96;
|
|
133
|
+
translate: 0 -6px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.dropdown-dialog.open.position-above {
|
|
137
|
+
translate: 0 6px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.dropdown-dialog.open .dropdown-options {
|
|
141
|
+
opacity: 0;
|
|
142
|
+
transform: translateY(-6px) scale(0.96);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dropdown-dialog.open.position-above .dropdown-options {
|
|
146
|
+
transform: translateY(6px) scale(0.96);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
127
150
|
.dropdown-dialog::backdrop {
|
|
128
151
|
background: transparent;
|
|
129
152
|
}
|
|
130
153
|
|
|
131
|
-
/* ===== DIALOG HEADER ===== */
|
|
132
|
-
|
|
133
154
|
.dropdown-header {
|
|
134
155
|
display: flex;
|
|
135
156
|
align-items: center;
|
|
@@ -138,6 +159,7 @@ export const selectBaseStyles = `
|
|
|
138
159
|
}
|
|
139
160
|
|
|
140
161
|
.dropdown-search-input {
|
|
162
|
+
font-family: inherit;
|
|
141
163
|
width: 100%;
|
|
142
164
|
min-width: 0;
|
|
143
165
|
box-sizing: border-box;
|
|
@@ -145,7 +167,7 @@ export const selectBaseStyles = `
|
|
|
145
167
|
color: var(--input-color, var(--ty-input-color));
|
|
146
168
|
border: 1px solid var(--input-border, var(--ty-input-border));
|
|
147
169
|
border-radius: var(--ty-radius-md);
|
|
148
|
-
font-family:
|
|
170
|
+
font-family: inherit;
|
|
149
171
|
font-size: var(--ty-font-sm);
|
|
150
172
|
line-height: var(--ty-leading-sm);
|
|
151
173
|
letter-spacing: var(--ty-tracking-sm);
|
|
@@ -194,9 +216,6 @@ export const selectBaseStyles = `
|
|
|
194
216
|
height: 100%;
|
|
195
217
|
}
|
|
196
218
|
|
|
197
|
-
/* ===== SELECT FIELD-SPECIFIC STYLES ===== */
|
|
198
|
-
|
|
199
|
-
/* Select stub modifications */
|
|
200
219
|
.select-stub {
|
|
201
220
|
min-height: var(--ty-size-md);
|
|
202
221
|
display: flex;
|
|
@@ -204,14 +223,13 @@ export const selectBaseStyles = `
|
|
|
204
223
|
gap: 0.25rem;
|
|
205
224
|
align-items: center;
|
|
206
225
|
padding: 0 2.5rem 0 0.75rem;
|
|
207
|
-
/* Transitions - includes opacity for open state */
|
|
208
226
|
transition: var(--ty-transition-all), opacity 0.2s ease;
|
|
209
227
|
outline: none;
|
|
210
228
|
background: var(--input-bg, var(--ty-input-bg));
|
|
211
229
|
color: var(--input-color, var(--ty-input-color));
|
|
212
230
|
border: 1px solid var(--select-accent, var(--input-border, var(--ty-input-border)));
|
|
213
231
|
border-radius: var(--ty-radius-md);
|
|
214
|
-
font-family:
|
|
232
|
+
font-family: inherit;
|
|
215
233
|
font-size: var(--ty-font-sm);
|
|
216
234
|
line-height: var(--ty-leading-sm);
|
|
217
235
|
letter-spacing: var(--ty-tracking-sm);
|
|
@@ -221,8 +239,7 @@ export const selectBaseStyles = `
|
|
|
221
239
|
box-sizing: border-box;
|
|
222
240
|
}
|
|
223
241
|
|
|
224
|
-
/*
|
|
225
|
-
buildStubClasses() always stamps exactly one size class on .select-stub.
|
|
242
|
+
/* buildStubClasses() always stamps exactly one size class on .select-stub.
|
|
226
243
|
min-height comes from the shared --ty-size-* tokens (same ones ty-input
|
|
227
244
|
and ty-date-picker consume) so a given size is the same height on every
|
|
228
245
|
field. Right padding stays 2.5rem for chevron room. Zero vertical
|
|
@@ -264,7 +281,6 @@ export const selectBaseStyles = `
|
|
|
264
281
|
opacity: 0.6;
|
|
265
282
|
}
|
|
266
283
|
|
|
267
|
-
/* Hide stub when dropdown is open */
|
|
268
284
|
.dropdown-wrapper:has(.dropdown-chevron.open) .select-stub {
|
|
269
285
|
opacity: 0;
|
|
270
286
|
pointer-events: none;
|
|
@@ -325,8 +341,6 @@ export const selectBaseStyles = `
|
|
|
325
341
|
gap: 0.25rem;
|
|
326
342
|
}
|
|
327
343
|
|
|
328
|
-
/* ===== CHEVRON INDICATOR ===== */
|
|
329
|
-
|
|
330
344
|
.dropdown-chevron {
|
|
331
345
|
position: absolute;
|
|
332
346
|
top: 50%;
|
|
@@ -349,7 +363,6 @@ export const selectBaseStyles = `
|
|
|
349
363
|
}
|
|
350
364
|
|
|
351
365
|
|
|
352
|
-
/* Tags container */
|
|
353
366
|
.select-chips {
|
|
354
367
|
display: flex;
|
|
355
368
|
flex-wrap: wrap;
|
|
@@ -358,8 +371,11 @@ export const selectBaseStyles = `
|
|
|
358
371
|
min-width: 0;
|
|
359
372
|
}
|
|
360
373
|
|
|
374
|
+
/* No flex-grow here — the placeholder only ever renders inside .select-stub,
|
|
375
|
+
and select.ts sets flex: 1 1 0% on it. A bare flex-grow: 1 (implicit
|
|
376
|
+
flex-basis:auto) is the wrap bug that fix exists to prevent; leaving it
|
|
377
|
+
here would silently reintroduce it if the specific rule ever moved. */
|
|
361
378
|
.dropdown-placeholder {
|
|
362
|
-
flex-grow: 1;
|
|
363
379
|
color: var(--input-placeholder, var(--ty-input-placeholder, #9ca3af));
|
|
364
380
|
font-size: var(--ty-font-sm);
|
|
365
381
|
line-height: var(--ty-leading-sm);
|
|
@@ -368,12 +384,10 @@ export const selectBaseStyles = `
|
|
|
368
384
|
font-style: italic;
|
|
369
385
|
}
|
|
370
386
|
|
|
371
|
-
/* Placeholder styling when tags are present */
|
|
372
387
|
.dropdown-placeholder.hidden {
|
|
373
388
|
display: none;
|
|
374
389
|
}
|
|
375
390
|
|
|
376
|
-
/* Options area styling - Override for select */
|
|
377
391
|
.dropdown-options {
|
|
378
392
|
opacity: 0;
|
|
379
393
|
/* Floating surface/border, not --input-* — this is a popup panel over
|
|
@@ -397,13 +411,12 @@ export const selectBaseStyles = `
|
|
|
397
411
|
0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
|
398
412
|
0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
399
413
|
|
|
400
|
-
|
|
401
|
-
transform:
|
|
414
|
+
transform: translateY(-6px) scale(0.96);
|
|
415
|
+
transform-origin: top center;
|
|
402
416
|
transition:
|
|
403
|
-
opacity
|
|
404
|
-
transform
|
|
417
|
+
opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
|
|
418
|
+
transform var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
|
|
405
419
|
|
|
406
|
-
/* Select-specific: flex wrap for tags */
|
|
407
420
|
display: flex;
|
|
408
421
|
flex-wrap: wrap;
|
|
409
422
|
padding: 0.5rem;
|
|
@@ -426,12 +439,10 @@ export const selectBaseStyles = `
|
|
|
426
439
|
position: relative;
|
|
427
440
|
}
|
|
428
441
|
|
|
429
|
-
/* Show custom scrollbar on hover */
|
|
430
442
|
.dropdown-options-wrapper:hover .ty-scrollbar-track-y.has-overflow {
|
|
431
443
|
opacity: 1;
|
|
432
444
|
}
|
|
433
445
|
|
|
434
|
-
/* Make ty-tags in dropdown clickable with pointer cursor */
|
|
435
446
|
.dropdown-options ty-tag {
|
|
436
447
|
user-select: none;
|
|
437
448
|
transition: transform 0.1s ease;
|
|
@@ -445,17 +456,14 @@ export const selectBaseStyles = `
|
|
|
445
456
|
transform: scale(0.98);
|
|
446
457
|
}
|
|
447
458
|
|
|
448
|
-
/* Visual feedback for selected tags in options */
|
|
449
459
|
.dropdown-options ty-tag[selected] {
|
|
450
460
|
opacity: 0.5;
|
|
451
461
|
}
|
|
452
462
|
|
|
453
|
-
/* Ensure ty-tag components in the select field have proper sizing */
|
|
454
463
|
.select-chips ty-tag {
|
|
455
464
|
max-width: 150px;
|
|
456
465
|
}
|
|
457
466
|
|
|
458
|
-
/* Responsive adjustments */
|
|
459
467
|
@media (max-width: 640px) {
|
|
460
468
|
.select-chips ty-tag {
|
|
461
469
|
max-width: 100px;
|
|
@@ -463,7 +471,6 @@ export const selectBaseStyles = `
|
|
|
463
471
|
}
|
|
464
472
|
|
|
465
473
|
|
|
466
|
-
/* Ensure proper spacing in container layouts */
|
|
467
474
|
.select-container {
|
|
468
475
|
display: flex;
|
|
469
476
|
flex-direction: column;
|
|
@@ -473,8 +480,6 @@ export const selectBaseStyles = `
|
|
|
473
480
|
which is exactly the 4px misalignment this used to cause. */
|
|
474
481
|
}
|
|
475
482
|
|
|
476
|
-
/* ===== DROPDOWN WRAPPER & LABEL ===== */
|
|
477
|
-
|
|
478
483
|
.dropdown-wrapper {
|
|
479
484
|
position: relative;
|
|
480
485
|
display: block;
|
|
@@ -493,7 +498,6 @@ export const selectBaseStyles = `
|
|
|
493
498
|
align-items: center;
|
|
494
499
|
}
|
|
495
500
|
|
|
496
|
-
/* Required indicator - using SVG icon */
|
|
497
501
|
.required-icon {
|
|
498
502
|
display: inline-flex;
|
|
499
503
|
align-items: center;
|
|
@@ -513,10 +517,6 @@ export const selectBaseStyles = `
|
|
|
513
517
|
pointer-events: none;
|
|
514
518
|
}
|
|
515
519
|
|
|
516
|
-
/* ============================================================================
|
|
517
|
-
MOBILE MODAL STYLES
|
|
518
|
-
============================================================================ */
|
|
519
|
-
|
|
520
520
|
.dropdown-mode-mobile .mobile-dialog {
|
|
521
521
|
position: fixed;
|
|
522
522
|
top: 0;
|
|
@@ -567,7 +567,7 @@ export const selectBaseStyles = `
|
|
|
567
567
|
display: flex;
|
|
568
568
|
flex-direction: column;
|
|
569
569
|
width: calc(100% - 32px); /* Side margins */
|
|
570
|
-
max-width: 400px;
|
|
570
|
+
max-width: 400px;
|
|
571
571
|
min-height: 200px;
|
|
572
572
|
max-height: 90dvh; /* leaves room below the 6dvh padding-top, shrinks with keyboard */
|
|
573
573
|
opacity: 0;
|
|
@@ -671,8 +671,8 @@ export const selectBaseStyles = `
|
|
|
671
671
|
height: 18px;
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
-
/* Mobile search input (matches dropdown.ts) */
|
|
675
674
|
.dropdown-mode-mobile .mobile-search-input {
|
|
675
|
+
font-family: inherit;
|
|
676
676
|
flex: 1;
|
|
677
677
|
min-width: 0;
|
|
678
678
|
box-sizing: border-box;
|
|
@@ -681,7 +681,7 @@ export const selectBaseStyles = `
|
|
|
681
681
|
border: 2px solid;
|
|
682
682
|
border-color: var(--mobile-border-color);
|
|
683
683
|
border-radius: var(--ty-radius-md);
|
|
684
|
-
font-family:
|
|
684
|
+
font-family: inherit;
|
|
685
685
|
font-size: var(--ty-font-sm);
|
|
686
686
|
line-height: var(--ty-leading-sm);
|
|
687
687
|
letter-spacing: var(--ty-tracking-sm);
|
|
@@ -700,10 +700,6 @@ export const selectBaseStyles = `
|
|
|
700
700
|
border-color: var(--ty-border);
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
-
/* ============================================================================
|
|
704
|
-
MOBILE BODY & SECTIONS - UPDATED STRUCTURE
|
|
705
|
-
============================================================================ */
|
|
706
|
-
|
|
707
703
|
/* Mobile body - contains both sections */
|
|
708
704
|
.dropdown-mode-mobile .mobile-body {
|
|
709
705
|
position: relative;
|
|
@@ -721,7 +717,7 @@ export const selectBaseStyles = `
|
|
|
721
717
|
border-color: var(--mobile-border-color);
|
|
722
718
|
}
|
|
723
719
|
|
|
724
|
-
/*
|
|
720
|
+
/* Section headers are labels, not buttons */
|
|
725
721
|
|
|
726
722
|
.dropdown-mode-mobile .section-header {
|
|
727
723
|
display: flex;
|
|
@@ -750,7 +746,7 @@ export const selectBaseStyles = `
|
|
|
750
746
|
margin-left: 0.25rem;
|
|
751
747
|
}
|
|
752
748
|
|
|
753
|
-
/*
|
|
749
|
+
/* Selected strip: pinned, capped height, collapses when empty */
|
|
754
750
|
|
|
755
751
|
.dropdown-mode-mobile .mobile-selected-section {
|
|
756
752
|
display: flex;
|
|
@@ -783,7 +779,7 @@ export const selectBaseStyles = `
|
|
|
783
779
|
mask-image: linear-gradient(to bottom, black calc(100% - 12px), transparent);
|
|
784
780
|
}
|
|
785
781
|
|
|
786
|
-
/*
|
|
782
|
+
/* Available list takes the remaining space */
|
|
787
783
|
|
|
788
784
|
.dropdown-mode-mobile .mobile-available-section {
|
|
789
785
|
display: flex;
|
|
@@ -806,8 +802,7 @@ export const selectBaseStyles = `
|
|
|
806
802
|
align-content: flex-start;
|
|
807
803
|
}
|
|
808
804
|
|
|
809
|
-
/*
|
|
810
|
-
Selected strip collapses (no text needed).
|
|
805
|
+
/* Selected strip collapses (no text needed).
|
|
811
806
|
Available shows the empty message only when there are zero tags total. */
|
|
812
807
|
|
|
813
808
|
.dropdown-mode-mobile .empty-state {
|
|
@@ -831,13 +826,11 @@ export const selectBaseStyles = `
|
|
|
831
826
|
display: none;
|
|
832
827
|
}
|
|
833
828
|
|
|
834
|
-
/* ===== TAG STYLING IN MOBILE ===== */
|
|
835
|
-
|
|
836
829
|
.dropdown-mode-mobile .section-content ::slotted(ty-tag) {
|
|
837
830
|
cursor: pointer;
|
|
838
831
|
user-select: none;
|
|
839
832
|
transition: transform 0.1s ease;
|
|
840
|
-
margin: 2px 0;
|
|
833
|
+
margin: 2px 0;
|
|
841
834
|
/* Fade + scale entry — replays on each (re)insertion when a tag moves
|
|
842
835
|
between selected and available slots */
|
|
843
836
|
animation: ty-select-tag-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
@@ -853,7 +846,6 @@ export const selectBaseStyles = `
|
|
|
853
846
|
transform: scale(0.96);
|
|
854
847
|
}
|
|
855
848
|
|
|
856
|
-
/* Dimmed appearance for hidden filtered tags */
|
|
857
849
|
.dropdown-mode-mobile .section-content ::slotted(ty-tag[hidden]) {
|
|
858
850
|
display: none !important;
|
|
859
851
|
}
|
|
@@ -869,8 +861,7 @@ export const selectBaseStyles = `
|
|
|
869
861
|
}
|
|
870
862
|
}
|
|
871
863
|
|
|
872
|
-
/*
|
|
873
|
-
Spinner overlay shown inside the options area while the parent
|
|
864
|
+
/* Spinner overlay shown inside the options area while the parent
|
|
874
865
|
(external-search mode) is fetching. Search input stays usable.
|
|
875
866
|
|
|
876
867
|
Carries its own surface so it stays visible even when the host
|
|
@@ -964,10 +955,8 @@ export const selectBaseStyles = `
|
|
|
964
955
|
}
|
|
965
956
|
}
|
|
966
957
|
|
|
967
|
-
/* Custom scrollbar styles */
|
|
968
958
|
${customScrollbarStyles}
|
|
969
959
|
|
|
970
|
-
/*
|
|
960
|
+
/* Flavor variants set --select-accent*, consumed above */
|
|
971
961
|
${FLAVORS.filter((f) => f !== "neutral").map((f) => selectFlavor(f)).join("")}
|
|
972
962
|
`;
|
|
973
|
-
//# sourceMappingURL=select-base.js.map
|
package/lib/styles/select.d.ts
CHANGED
|
@@ -8,5 +8,4 @@
|
|
|
8
8
|
* - .compact: content-hugging trigger for toolbars, count badge
|
|
9
9
|
* - .custom-trigger (slot="trigger"): all chrome stripped
|
|
10
10
|
*/
|
|
11
|
-
export declare const selectStyles = "\n/* ===== COMPACT skin: hugs content (field skin = base styles) ===== */\n.select-stub.compact {\n display: inline-flex;\n flex-wrap: nowrap;\n width: auto;\n gap: 0.5rem;\n /* extra right padding = room for the absolutely-positioned chevron */\n padding: 0.5rem 2.25rem 0.5rem 0.875rem;\n}\n\n/* Consumer-provided trigger (slot=\"trigger\"): no chrome at all */\n.select-stub.custom-trigger {\n display: inline-block;\n width: auto;\n border: none;\n background: none;\n padding: 0;\n min-height: 0;\n border-radius: 0;\n}\n.select-stub.custom-trigger:hover {\n border: none;\n}\n\n.select-count {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 9999px;\n /* --ty-text-primary never existed as a token \u2014 this silently fell back\n to inherited/unset color. Now follows the select's own flavor. */\n background: color-mix(in oklab, var(--select-accent, var(--ty-color-primary)) 15%, transparent);\n color: var(--select-accent-bold, var(--ty-color-primary-strong));\n font-size: var(--ty-font-xs);\n font-weight: var(--ty-font-semibold);\n font-style: normal;\n}\n.select-count[hidden] {\n display: none;\n}\n\n/* Clear (x) button \u2014 normal flex child of .select-stub, not absolutely\n positioned like .dropdown-chevron: it just takes its own space in the\n row, no padding-right gutter math needed. Lives in the trigger slot's\n fallback content, so it's automatically absent under slot=\"trigger\". */\n.select-clear {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n padding: 0;\n border: none;\n background: none;\n color: var(--input-placeholder, var(--ty-input-placeholder));\n cursor: pointer;\n border-radius: var(--ty-radius-sm);\n transition: var(--ty-local-transition, all 0.15s ease);\n}\n.select-clear[hidden] {\n display: none;\n}\n.select-clear:hover {\n /* Destructive utility action \u2014 neutral at rest, warns danger-red on\n hover regardless of the field's own flavor. */\n color: var(--ty-color-danger);\n background-color: var(--ty-bg-danger-soft);\n}\n.select-clear svg {\n width: 100%;\n height: 100%;\n}\n\n/* Selection text (field skin): single line, ellipsis, input colors.\n flex-basis 0, not auto \u2014 .select-stub is flex-wrap:wrap, and auto's\n hypothetical size is the FULL untruncated text width (wrap-line\n assignment happens before shrinking), which pushed fixed-size siblings\n (.select-clear) onto a second line even though the text visibly had\n room after truncating. 0 makes this item contribute ~nothing to the\n line-fit check up front; grow/shrink + overflow:hidden still truncate\n it identically. */\n.select-stub .dropdown-placeholder {\n font-style: normal;\n flex: 1 1 0%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--input-color, var(--ty-input-color));\n}\n\n/* Empty state: muted placeholder color */\n.select-stub .dropdown-placeholder.placeholder-shown {\n color: var(--input-placeholder, var(--ty-input-placeholder));\n}\n.select-stub .dropdown-placeholder[hidden] {\n display: none;\n}\n\n/* Single-select display clone (slot=\"selected\"): the selected ty-option\n projected into the stub \u2014 its own :host([cloned]) styling strips the\n list-row chrome; here it just takes the text's flex slot. */\n.select-stub slot[name=\"selected\"] {\n display: none;\n}\n.select-stub.has-clone slot[name=\"selected\"] {\n display: block;\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n}\n.select-stub.compact.has-clone slot[name=\"selected\"] {\n flex: 0 1 auto;\n}\n\n/* start/end slot content (icons etc.) \u2014 spacing comes from the stub's flex\n gap; muted like ty-input adornments. end sits before the chevron. */\n.select-stub ::slotted([slot=\"start\"]),\n.select-stub ::slotted([slot=\"end\"]) {\n flex-shrink: 0;\n color: var(--ty-text-soft);\n}\n\n/* Compact skin: the text IS the trigger label \u2014 no grow, regular text color.\n flex-basis: auto (not the field skin's 0%) \u2014 content-hugging needs its\n natural content width as the starting point; 0% would collapse it since\n grow is also 0 here (nothing left to expand it back out). */\n.select-stub.compact .dropdown-placeholder {\n flex: 0 1 auto;\n color: var(--ty-text);\n}\n\n/* Trigger stays visible while the popup is open (the popup hides it) */\n.dropdown-wrapper:has(.dropdown-chevron.open) .select-stub {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* ===== One-panel popup: search header fused with the options list ===== */\n\n/* Single unified shadow around the whole panel (header + list as one silhouette) */\n.dropdown-dialog.open {\n filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));\n}\n\n/* Card-style header: the search input keeps its own bordered-field look\n (base styles) and sits inset in the panel, TagPicker-style \u2014 no divider,\n whitespace separates it from the list. The header's OWN surface/border is\n part of the floating panel's chrome, not a form field \u2014 --ty-surface-\n floating/--ty-floating-border, matching .dropdown-options below it (same\n reasoning as the base-panel fix: --ty-input-* is deliberately faint for\n resting form fields and read as a missing/mismatched edge here). */\n.dropdown-header {\n background: var(--ty-surface-floating);\n border: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n padding: var(--ty-spacing-2) var(--ty-spacing-2) var(--ty-spacing-1);\n}\n.dropdown-dialog.position-below .dropdown-header {\n margin-bottom: 0;\n}\n.dropdown-dialog.position-above .dropdown-header {\n margin-top: 0;\n border-top: none;\n border-bottom: 1px solid var(--ty-floating-border);\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n padding: var(--ty-spacing-1) var(--ty-spacing-2) var(--ty-spacing-2);\n}\n\n/* Magnifier adornment inside the search field (header padding + field inset) */\n.dropdown-search-icon {\n position: absolute;\n top: 50%;\n left: calc(var(--ty-spacing-2) + var(--ty-spacing-3));\n transform: translateY(-50%);\n width: 1rem;\n height: 1rem;\n color: var(--input-placeholder, var(--ty-input-placeholder));\n pointer-events: none;\n}\n.dropdown-search-icon svg {\n width: 100%;\n height: 100%;\n}\n\n/* Mobile header: flex row, icon flows inline before the input. Same 32x32\n footprint as .mobile-close-button (18px glyph centered in the box, not a\n bare 18px glyph flush at the edge) so the row has two matching bookends \u2014\n a bare icon on one side and a 32px circle on the other read as lopsided\n even with equal flex gap on both sides. Matching them also centers the\n search input's flex:1 fill symmetrically between the two. Fixed white +\n 18px glyph, same reasoning as .mobile-header-label \u2014 this sits on the\n dark ::backdrop blur in both themes, not a theme surface. */\n.dropdown-mode-mobile .mobile-header-content .dropdown-search-icon {\n position: static;\n transform: none;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n color: #ffffff;\n}\n.dropdown-mode-mobile .mobile-header-content .dropdown-search-icon svg {\n width: 18px;\n height: 18px;\n}\n\n/* Search input: bordered field from base styles; just size + icon room */\n.dropdown-search-input {\n min-height: 2.25rem;\n padding-right: var(--ty-spacing-2);\n /* room for the magnifier adornment */\n padding-left: calc(var(--ty-spacing-3) + 1rem + var(--ty-spacing-2));\n}\n/* Trigger already has a chevron - no second one inside the search row */\n.dropdown-search-chevron {\n display: none;\n}\n\n/* With the search row hidden nothing inside is focusable, so the <dialog>\n itself receives focus on open \u2014 suppress its UA focus ring */\n.dropdown-dialog:focus,\n.dropdown-dialog:focus-visible {\n outline: none;\n}\n\n/* Search row hidden ('auto' below threshold / searchable=\"false\"):\n the options panel owns the whole silhouette */\n.dropdown-header[hidden] {\n display: none;\n}\n.dropdown-header[hidden] ~ .dropdown-options-wrapper .dropdown-options {\n border-top: 1px solid var(--ty-floating-border);\n border-radius: var(--ty-radius-lg);\n}\n.mobile-search-input[hidden],\n.mobile-header-content .dropdown-search-icon[hidden] {\n display: none;\n}\n\n/* Options: vertical list rows fused under the search header.\n No own shadow/animation - the panel appears as one via dialog opacity. */\n.dropdown-options {\n flex-direction: column;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: 0;\n /* Card-style list: rounded rows sit inset from the panel edges */\n padding: var(--ty-spacing-1);\n border-top: none;\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n box-shadow: none;\n transform: none;\n transition: none;\n /* ~9-10 visible rows before scrolling (custom scrollbar, native hidden) */\n max-height: 24rem;\n}\n.dropdown-dialog.position-below .dropdown-options {\n box-shadow: none;\n}\n.dropdown-dialog.position-above .dropdown-options {\n border-top: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n}\n\n/* Loading panel continues the fused silhouette exactly like .dropdown-options \u2014\n the base layer styles it as a floating card (radius + shadow), which left a\n see-through gap under the search header while loading. */\n.dropdown-loading {\n border-top: none;\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n box-shadow: none;\n}\n.dropdown-dialog.position-above .dropdown-loading {\n border-top: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n}\n\n/* Selection tick lives inside ty-option (lucide check on [selected]) */\n\n/* Mobile modal: same vertical list */\n.dropdown-mode-mobile .section-content ::slotted(ty-option) {\n display: block;\n width: 100%;\n}\n";
|
|
12
|
-
//# sourceMappingURL=select.d.ts.map
|
|
11
|
+
export declare const selectStyles = "\n/* Compact skin hugs its content (field skin = base styles) */\n.select-stub.compact {\n display: inline-flex;\n flex-wrap: nowrap;\n width: auto;\n gap: 0.5rem;\n /* extra right padding = room for the absolutely-positioned chevron */\n padding: 0.5rem 2.25rem 0.5rem 0.875rem;\n}\n\n/* Consumer-provided trigger (slot=\"trigger\"): no chrome at all */\n.select-stub.custom-trigger {\n display: inline-block;\n width: auto;\n border: none;\n background: none;\n padding: 0;\n min-height: 0;\n border-radius: 0;\n}\n.select-stub.custom-trigger:hover {\n border: none;\n}\n\n.select-count {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 9999px;\n /* --ty-text-primary never existed as a token \u2014 this silently fell back\n to inherited/unset color. Now follows the select's own flavor. */\n background: color-mix(in oklab, var(--select-accent, var(--ty-color-primary)) 15%, transparent);\n color: var(--select-accent-bold, var(--ty-color-primary-strong));\n font-size: var(--ty-font-xs);\n font-weight: var(--ty-font-semibold);\n font-style: normal;\n}\n.select-count[hidden] {\n display: none;\n}\n\n/* Clear (x) button \u2014 normal flex child of .select-stub, not absolutely\n positioned like .dropdown-chevron: it just takes its own space in the\n row, no padding-right gutter math needed. Lives in the trigger slot's\n fallback content, so it's automatically absent under slot=\"trigger\". */\n.select-clear {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n padding: 0;\n border: none;\n background: none;\n color: var(--input-placeholder, var(--ty-input-placeholder));\n cursor: pointer;\n border-radius: var(--ty-radius-sm);\n transition: var(--ty-local-transition, all 0.15s ease);\n}\n.select-clear[hidden] {\n display: none;\n}\n.select-clear:hover {\n /* Destructive utility action \u2014 neutral at rest, warns danger-red on\n hover regardless of the field's own flavor. */\n color: var(--ty-color-danger);\n background-color: var(--ty-bg-danger-soft);\n}\n.select-clear svg {\n width: 100%;\n height: 100%;\n}\n\n/* Selection text (field skin): single line, ellipsis, input colors.\n flex-basis 0, not auto \u2014 .select-stub is flex-wrap:wrap, and auto's\n hypothetical size is the FULL untruncated text width (wrap-line\n assignment happens before shrinking), which pushed fixed-size siblings\n (.select-clear) onto a second line even though the text visibly had\n room after truncating. 0 makes this item contribute ~nothing to the\n line-fit check up front; grow/shrink + overflow:hidden still truncate\n it identically. */\n.select-stub .dropdown-placeholder {\n font-style: normal;\n flex: 1 1 0%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--input-color, var(--ty-input-color));\n}\n\n.select-stub .dropdown-placeholder.placeholder-shown {\n color: var(--input-placeholder, var(--ty-input-placeholder));\n}\n.select-stub .dropdown-placeholder[hidden] {\n display: none;\n}\n\n/* Single-select display clone (slot=\"selected\"): the selected ty-option\n projected into the stub \u2014 its own :host([cloned]) styling strips the\n list-row chrome; here it just takes the text's flex slot. */\n.select-stub slot[name=\"selected\"] {\n display: none;\n}\n.select-stub.has-clone slot[name=\"selected\"] {\n display: block;\n /* flex-basis 0, not auto \u2014 same reasoning as .dropdown-placeholder above:\n .select-stub is flex-wrap:wrap, and auto's hypothetical size is the\n clone's full untruncated text width, which pushes .select-clear onto\n a second line. */\n flex: 1 1 0%;\n min-width: 0;\n overflow: hidden;\n}\n.select-stub.compact.has-clone slot[name=\"selected\"] {\n flex: 0 1 auto;\n}\n\n/* start/end slot content (icons etc.) \u2014 spacing comes from the stub's flex\n gap; muted like ty-input adornments. end sits before the chevron. */\n.select-stub ::slotted([slot=\"start\"]),\n.select-stub ::slotted([slot=\"end\"]) {\n flex-shrink: 0;\n color: var(--ty-text-soft);\n}\n\n/* Compact skin: the text IS the trigger label \u2014 no grow, regular text color.\n flex-basis: auto (not the field skin's 0%) \u2014 content-hugging needs its\n natural content width as the starting point; 0% would collapse it since\n grow is also 0 here (nothing left to expand it back out). */\n.select-stub.compact .dropdown-placeholder {\n flex: 0 1 auto;\n color: var(--ty-text);\n}\n\n/* Trigger stays visible while the popup is open (the popup hides it) */\n.dropdown-wrapper:has(.dropdown-chevron.open) .select-stub {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* One-panel popup: search header fused with the options list */\n\n/* Single unified shadow around the whole panel (header + list as one silhouette) */\n.dropdown-dialog.open {\n filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));\n}\n\n/* Card-style header: the search input keeps its own bordered-field look\n (base styles) and sits inset in the panel, TagPicker-style \u2014 no divider,\n whitespace separates it from the list. The header's OWN surface/border is\n part of the floating panel's chrome, not a form field \u2014 --ty-surface-\n floating/--ty-floating-border, matching .dropdown-options below it (same\n reasoning as the base-panel fix: --ty-input-* is deliberately faint for\n resting form fields and read as a missing/mismatched edge here). */\n.dropdown-header {\n background: var(--ty-surface-floating);\n border: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n padding: var(--ty-spacing-2) var(--ty-spacing-2) var(--ty-spacing-1);\n}\n.dropdown-dialog.position-below .dropdown-header {\n margin-bottom: 0;\n}\n.dropdown-dialog.position-above .dropdown-header {\n margin-top: 0;\n border-top: none;\n border-bottom: 1px solid var(--ty-floating-border);\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n padding: var(--ty-spacing-1) var(--ty-spacing-2) var(--ty-spacing-2);\n}\n\n/* Magnifier adornment inside the search field (header padding + field inset) */\n.dropdown-search-icon {\n position: absolute;\n top: 50%;\n left: calc(var(--ty-spacing-2) + var(--ty-spacing-3));\n transform: translateY(-50%);\n width: 1rem;\n height: 1rem;\n color: var(--input-placeholder, var(--ty-input-placeholder));\n pointer-events: none;\n}\n.dropdown-search-icon svg {\n width: 100%;\n height: 100%;\n}\n\n/* Mobile header: flex row, icon flows inline before the input. Same 32x32\n footprint as .mobile-close-button (18px glyph centered in the box, not a\n bare 18px glyph flush at the edge) so the row has two matching bookends \u2014\n a bare icon on one side and a 32px circle on the other read as lopsided\n even with equal flex gap on both sides. Matching them also centers the\n search input's flex:1 fill symmetrically between the two. Fixed white +\n 18px glyph, same reasoning as .mobile-header-label \u2014 this sits on the\n dark ::backdrop blur in both themes, not a theme surface. */\n.dropdown-mode-mobile .mobile-header-content .dropdown-search-icon {\n position: static;\n transform: none;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n color: #ffffff;\n}\n.dropdown-mode-mobile .mobile-header-content .dropdown-search-icon svg {\n width: 18px;\n height: 18px;\n}\n\n/* Search input: bordered field from base styles; just size + icon room */\n.dropdown-search-input {\n min-height: 2.25rem;\n padding-right: var(--ty-spacing-2);\n /* room for the magnifier adornment */\n padding-left: calc(var(--ty-spacing-3) + 1rem + var(--ty-spacing-2));\n}\n/* Trigger already has a chevron - no second one inside the search row */\n.dropdown-search-chevron {\n display: none;\n}\n\n/* With the search row hidden nothing inside is focusable, so the <dialog>\n itself receives focus on open \u2014 suppress its UA focus ring */\n.dropdown-dialog:focus,\n.dropdown-dialog:focus-visible {\n outline: none;\n}\n\n/* Search row hidden ('auto' below threshold / searchable=\"false\"):\n the options panel owns the whole silhouette */\n.dropdown-header[hidden] {\n display: none;\n}\n.dropdown-header[hidden] ~ .dropdown-options-wrapper .dropdown-options {\n border-top: 1px solid var(--ty-floating-border);\n border-radius: var(--ty-radius-lg);\n}\n.mobile-search-input[hidden],\n.mobile-header-content .dropdown-search-icon[hidden] {\n display: none;\n}\n\n/* Options: vertical list rows fused under the search header.\n No own shadow/animation - the panel appears as one via dialog opacity. */\n.dropdown-options {\n flex-direction: column;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: 0;\n /* Card-style list: rounded rows sit inset from the panel edges */\n padding: var(--ty-spacing-1);\n border-top: none;\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n box-shadow: none;\n transform: none;\n transition: none;\n /* ~9-10 visible rows before scrolling (custom scrollbar, native hidden) */\n max-height: 24rem;\n}\n.dropdown-dialog.position-below .dropdown-options {\n box-shadow: none;\n}\n.dropdown-dialog.position-above .dropdown-options {\n border-top: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n}\n\n/* Loading panel continues the fused silhouette exactly like .dropdown-options \u2014\n the base layer styles it as a floating card (radius + shadow), which left a\n see-through gap under the search header while loading. */\n.dropdown-loading {\n border-top: none;\n border-radius: 0 0 var(--ty-radius-lg) var(--ty-radius-lg);\n box-shadow: none;\n}\n.dropdown-dialog.position-above .dropdown-loading {\n border-top: 1px solid var(--ty-floating-border);\n border-bottom: none;\n border-radius: var(--ty-radius-lg) var(--ty-radius-lg) 0 0;\n}\n\n/* Selection tick lives inside ty-option (lucide check on [selected]) */\n\n/* Mobile modal: same vertical list */\n.dropdown-mode-mobile .section-content ::slotted(ty-option) {\n display: block;\n width: 100%;\n}\n";
|
package/lib/styles/select.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Select Component Styles
|
|
3
|
-
* Layered over the shared select-field styles (popup, mobile modal, search).
|
|
4
|
-
*
|
|
5
|
-
* Skins:
|
|
6
|
-
* - default FIELD: the base .select-stub already carries the form-field
|
|
7
|
-
* look (width 100%, --ty-input-* tokens) — only text treatment added here
|
|
8
|
-
* - .compact: content-hugging trigger for toolbars, count badge
|
|
9
|
-
* - .custom-trigger (slot="trigger"): all chrome stripped
|
|
10
|
-
*/
|
|
11
1
|
export const selectStyles = `
|
|
12
|
-
/*
|
|
2
|
+
/* Compact skin hugs its content (field skin = base styles) */
|
|
13
3
|
.select-stub.compact {
|
|
14
4
|
display: inline-flex;
|
|
15
5
|
flex-wrap: nowrap;
|
|
@@ -105,7 +95,6 @@ export const selectStyles = `
|
|
|
105
95
|
color: var(--input-color, var(--ty-input-color));
|
|
106
96
|
}
|
|
107
97
|
|
|
108
|
-
/* Empty state: muted placeholder color */
|
|
109
98
|
.select-stub .dropdown-placeholder.placeholder-shown {
|
|
110
99
|
color: var(--input-placeholder, var(--ty-input-placeholder));
|
|
111
100
|
}
|
|
@@ -121,7 +110,11 @@ export const selectStyles = `
|
|
|
121
110
|
}
|
|
122
111
|
.select-stub.has-clone slot[name="selected"] {
|
|
123
112
|
display: block;
|
|
124
|
-
flex
|
|
113
|
+
/* flex-basis 0, not auto — same reasoning as .dropdown-placeholder above:
|
|
114
|
+
.select-stub is flex-wrap:wrap, and auto's hypothetical size is the
|
|
115
|
+
clone's full untruncated text width, which pushes .select-clear onto
|
|
116
|
+
a second line. */
|
|
117
|
+
flex: 1 1 0%;
|
|
125
118
|
min-width: 0;
|
|
126
119
|
overflow: hidden;
|
|
127
120
|
}
|
|
@@ -152,7 +145,7 @@ export const selectStyles = `
|
|
|
152
145
|
pointer-events: auto;
|
|
153
146
|
}
|
|
154
147
|
|
|
155
|
-
/*
|
|
148
|
+
/* One-panel popup: search header fused with the options list */
|
|
156
149
|
|
|
157
150
|
/* Single unified shadow around the whole panel (header + list as one silhouette) */
|
|
158
151
|
.dropdown-dialog.open {
|
|
@@ -305,4 +298,3 @@ export const selectStyles = `
|
|
|
305
298
|
width: 100%;
|
|
306
299
|
}
|
|
307
300
|
`;
|
|
308
|
-
//# sourceMappingURL=select.js.map
|
package/lib/styles/step.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Step Component Styles
|
|
3
3
|
*/
|
|
4
|
-
export declare const stepStyles = "\n:host {\n width: var(--ty-wizard-width, 100%);\n height: calc(var(--ty-wizard-height, 700px) - var(--ty-wizard-indicators-height, 120px));\n display: block;\n box-sizing: border-box;\n flex-shrink: 0;\n transition: opacity var(--ty-wizard-transition-duration, 400ms) var(--ty-wizard-transition-easing, ease-in-out);\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host {\n transition-duration: 0ms !important;\n }\n}\n\n.step-wrapper {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.step-panel {\n width: 100%;\n height: 100%;\n overflow: auto;\n box-sizing: border-box;\n}\n\n.step-panel.ty-custom-scroll {\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.step-panel.ty-custom-scroll::-webkit-scrollbar {\n display: none;\n}\n\n.step-wrapper:hover .ty-scrollbar-track-y.has-overflow {\n opacity: 1;\n}\n\n\n/*
|
|
5
|
-
//# sourceMappingURL=step.d.ts.map
|
|
4
|
+
export declare const stepStyles = "\n:host {\n width: var(--ty-wizard-width, 100%);\n height: calc(var(--ty-wizard-height, 700px) - var(--ty-wizard-indicators-height, 120px));\n display: block;\n box-sizing: border-box;\n flex-shrink: 0;\n transition: opacity var(--ty-wizard-transition-duration, 400ms) var(--ty-wizard-transition-easing, ease-in-out);\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host {\n transition-duration: 0ms !important;\n }\n}\n\n.step-wrapper {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.step-panel {\n width: 100%;\n height: 100%;\n overflow: auto;\n box-sizing: border-box;\n}\n\n.step-panel.ty-custom-scroll {\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.step-panel.ty-custom-scroll::-webkit-scrollbar {\n display: none;\n}\n\n.step-wrapper:hover .ty-scrollbar-track-y.has-overflow {\n opacity: 1;\n}\n\n\n/* Vertical track */\n.ty-scrollbar-track-y {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--ty-scrollbar-width, 8px);\n z-index: 3;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.25s ease-out;\n cursor: pointer;\n}\n\n.ty-scrollbar-track-y.has-overflow {\n pointer-events: auto;\n}\n\n.ty-scrollbar-track-y.has-overflow:hover,\n.ty-scrollbar-track-y.has-overflow.scrolling,\n.ty-scrollbar-track-y.dragging {\n opacity: 1;\n}\n\n.ty-scrollbar-track-y::before {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--ty-scrollbar-track, transparent);\n border-radius: var(--ty-scrollbar-radius, 4px);\n opacity: 0;\n transition: opacity 0.15s ease-out;\n}\n\n.ty-scrollbar-track-y:hover::before,\n.ty-scrollbar-track-y.dragging::before {\n opacity: 1;\n background: var(--ty-scrollbar-track-hover, color-mix(in oklab, var(--ty-color-neutral-bold) 8%, transparent));\n}\n\n.ty-scrollbar-thumb-y {\n position: absolute;\n right: 0;\n width: 100%;\n min-height: var(--ty-scrollbar-thumb-min-height, 30px);\n background: var(--ty-scrollbar-thumb, color-mix(in oklab, var(--ty-color-neutral-bold) 40%, transparent));\n border-radius: var(--ty-scrollbar-radius, 4px);\n transition: var(--ty-local-transition, background 0.15s ease-out);\n box-sizing: border-box;\n border: 1px solid transparent;\n}\n\n.ty-scrollbar-thumb-y:hover,\n.ty-scrollbar-track-y.dragging .ty-scrollbar-thumb-y {\n background: var(--ty-scrollbar-thumb-hover, color-mix(in oklab, var(--ty-color-neutral-bold) 55%, transparent));\n}\n\n.ty-scrollbar-thumb-y:active,\n.ty-scrollbar-track-y.dragging .ty-scrollbar-thumb-y {\n background: var(--ty-scrollbar-thumb-active, color-mix(in oklab, var(--ty-color-neutral-bold) 70%, transparent));\n}\n\n/* Horizontal track */\n.ty-scrollbar-track-x {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: var(--ty-scrollbar-width, 8px);\n z-index: 3;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.25s ease-out;\n cursor: pointer;\n}\n\n.ty-scrollbar-track-x.has-overflow {\n pointer-events: auto;\n}\n\n.ty-scrollbar-track-x.has-overflow:hover,\n.ty-scrollbar-track-x.has-overflow.scrolling,\n.ty-scrollbar-track-x.dragging {\n opacity: 1;\n}\n\n.ty-scrollbar-track-x::before {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--ty-scrollbar-track, transparent);\n border-radius: var(--ty-scrollbar-radius, 4px);\n opacity: 0;\n transition: opacity 0.15s ease-out;\n}\n\n.ty-scrollbar-track-x:hover::before,\n.ty-scrollbar-track-x.dragging::before {\n opacity: 1;\n background: var(--ty-scrollbar-track-hover, color-mix(in oklab, var(--ty-color-neutral-bold) 8%, transparent));\n}\n\n.ty-scrollbar-thumb-x {\n position: absolute;\n bottom: 0;\n height: 100%;\n min-width: var(--ty-scrollbar-thumb-min-height, 30px);\n background: var(--ty-scrollbar-thumb, color-mix(in oklab, var(--ty-color-neutral-bold) 40%, transparent));\n border-radius: var(--ty-scrollbar-radius, 4px);\n transition: var(--ty-local-transition, background 0.15s ease-out);\n box-sizing: border-box;\n border: 1px solid transparent;\n}\n\n.ty-scrollbar-thumb-x:hover,\n.ty-scrollbar-track-x.dragging .ty-scrollbar-thumb-x {\n background: var(--ty-scrollbar-thumb-hover, color-mix(in oklab, var(--ty-color-neutral-bold) 55%, transparent));\n}\n\n.ty-scrollbar-thumb-x:active,\n.ty-scrollbar-track-x.dragging .ty-scrollbar-thumb-x {\n background: var(--ty-scrollbar-thumb-active, color-mix(in oklab, var(--ty-color-neutral-bold) 70%, transparent));\n}\n\n/* Touch devices: hide the custom scrollbar */\n@media (pointer: coarse) and (hover: none) {\n .ty-scrollbar-track-y,\n .ty-scrollbar-track-x {\n display: none !important;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ty-scrollbar-track-y,\n .ty-scrollbar-track-x,\n .ty-scrollbar-thumb-y,\n .ty-scrollbar-thumb-x {\n transition-duration: 0ms !important;\n }\n}\n\n";
|
package/lib/styles/step.js
CHANGED
package/lib/styles/switch.d.ts
CHANGED
package/lib/styles/switch.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Switch Component Styles
|
|
3
|
-
* Track + thumb visual, ARIA role="switch".
|
|
4
|
-
*
|
|
5
|
-
* Reuses input-container/error-message rules from input styles for label
|
|
6
|
-
* and error layout consistency.
|
|
7
|
-
*/
|
|
8
1
|
import { FLAVORS } from "../types/common.js";
|
|
9
2
|
import { inputStyles } from "./input.js";
|
|
10
|
-
/* Flavor rules only set --switch-track; the single checked-state rule below
|
|
11
|
-
consumes it. The var doubles as the per-instance override API:
|
|
12
|
-
`ty-switch { --switch-track: … }` (outer-document host rules beat :host).
|
|
13
|
-
Optional fallback flavor `fb` is used for custom flavors so missing
|
|
14
|
-
tokens degrade to neutral instead of an unstyled track. */
|
|
15
3
|
const switchFlavor = (f, fb) => {
|
|
16
4
|
const tok = (s) => fb
|
|
17
5
|
? `var(--ty-color-${f}${s}, var(--ty-color-${fb}${s}))`
|
|
@@ -22,7 +10,6 @@ const switchFlavor = (f, fb) => {
|
|
|
22
10
|
:host([flavor="${f}-"]) { --switch-track: ${tok("-soft")}; }
|
|
23
11
|
`;
|
|
24
12
|
};
|
|
25
|
-
/** Rules for one custom (non-built-in) flavor — see utils/flavor-sheet.ts. */
|
|
26
13
|
export const switchCustomFlavorCss = (base) => switchFlavor(base, "neutral");
|
|
27
14
|
export const switchStyles = `
|
|
28
15
|
${inputStyles}
|
|
@@ -34,7 +21,7 @@ ${inputStyles}
|
|
|
34
21
|
vertical-align: middle;
|
|
35
22
|
}
|
|
36
23
|
|
|
37
|
-
/*
|
|
24
|
+
/* The switch container is just the visual */
|
|
38
25
|
.switch-container {
|
|
39
26
|
display: inline-block;
|
|
40
27
|
cursor: pointer;
|
|
@@ -53,7 +40,6 @@ ${inputStyles}
|
|
|
53
40
|
box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
|
|
54
41
|
}
|
|
55
42
|
|
|
56
|
-
/* ===== TRACK ===== */
|
|
57
43
|
.switch-track {
|
|
58
44
|
position: relative;
|
|
59
45
|
flex-shrink: 0;
|
|
@@ -65,7 +51,6 @@ ${inputStyles}
|
|
|
65
51
|
box-sizing: border-box;
|
|
66
52
|
}
|
|
67
53
|
|
|
68
|
-
/* ===== THUMB ===== */
|
|
69
54
|
.switch-thumb {
|
|
70
55
|
position: absolute;
|
|
71
56
|
top: 2px;
|
|
@@ -78,7 +63,6 @@ ${inputStyles}
|
|
|
78
63
|
transition: var(--ty-local-transition, transform 0.18s ease-in-out, background-color 0.18s ease-in-out);
|
|
79
64
|
}
|
|
80
65
|
|
|
81
|
-
/* ===== CHECKED STATE ===== */
|
|
82
66
|
/* Default (no flavor attribute) is primary — defaults don't reflect to the
|
|
83
67
|
host attribute, so the base rule's fallback carries the default look. */
|
|
84
68
|
.switch-container[aria-checked="true"] .switch-track {
|
|
@@ -89,7 +73,6 @@ ${inputStyles}
|
|
|
89
73
|
transform: translateX(16px);
|
|
90
74
|
}
|
|
91
75
|
|
|
92
|
-
/* ===== SIZE VARIANTS ===== */
|
|
93
76
|
.switch-container.xs .switch-track { width: 26px; height: 14px; }
|
|
94
77
|
.switch-container.xs .switch-thumb { width: 10px; height: 10px; }
|
|
95
78
|
.switch-container.xs[aria-checked="true"] .switch-thumb { transform: translateX(12px); }
|
|
@@ -108,8 +91,7 @@ ${inputStyles}
|
|
|
108
91
|
.switch-container.xl .switch-thumb { width: 24px; height: 24px; }
|
|
109
92
|
.switch-container.xl[aria-checked="true"] .switch-thumb { transform: translateX(24px); }
|
|
110
93
|
|
|
111
|
-
/*
|
|
94
|
+
/* Flavor variants set --switch-track, consumed above */
|
|
112
95
|
${FLAVORS.map((f) => switchFlavor(f)).join("")}
|
|
113
96
|
|
|
114
97
|
`;
|
|
115
|
-
//# sourceMappingURL=switch.js.map
|