tyrell-components 1.0.0-RC14 → 1.0.0-RC15

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.
Files changed (113) hide show
  1. package/README.md +9 -1
  2. package/css/tyrell-theme.css +25 -2
  3. package/css/tyrell.css +4 -0
  4. package/dist/tyrell-colors-static.css +1 -316
  5. package/dist/tyrell-theme.css +1 -1443
  6. package/dist/tyrell.css +1 -1390
  7. package/dist/tyrell.js +1 -1
  8. package/lib/base/ty-component.js +196 -196
  9. package/lib/components/button.d.ts +1 -1
  10. package/lib/components/button.js +261 -259
  11. package/lib/components/calendar-month.d.ts +2 -2
  12. package/lib/components/calendar-month.js +439 -416
  13. package/lib/components/calendar-navigation.js +238 -238
  14. package/lib/components/calendar.d.ts +5 -3
  15. package/lib/components/calendar.js +611 -602
  16. package/lib/components/checkbox.d.ts +1 -1
  17. package/lib/components/checkbox.js +273 -272
  18. package/lib/components/copy.d.ts +1 -1
  19. package/lib/components/copy.js +280 -278
  20. package/lib/components/date-picker.d.ts +8 -1
  21. package/lib/components/date-picker.js +1128 -1108
  22. package/lib/components/file-upload.js +404 -404
  23. package/lib/components/icon.js +141 -141
  24. package/lib/components/input.d.ts +1 -1
  25. package/lib/components/input.js +593 -596
  26. package/lib/components/modal.js +319 -319
  27. package/lib/components/option.js +167 -167
  28. package/lib/components/popup.js +233 -233
  29. package/lib/components/radio.d.ts +2 -2
  30. package/lib/components/radio.js +407 -406
  31. package/lib/components/resize-observer.js +67 -67
  32. package/lib/components/scroll-container.js +292 -294
  33. package/lib/components/select.d.ts +71 -12
  34. package/lib/components/select.js +1605 -1529
  35. package/lib/components/selected-tags.d.ts +1 -1
  36. package/lib/components/selected-tags.js +188 -182
  37. package/lib/components/step.js +62 -62
  38. package/lib/components/switch.d.ts +1 -1
  39. package/lib/components/switch.js +214 -213
  40. package/lib/components/tab.js +62 -62
  41. package/lib/components/tabs.d.ts +1 -0
  42. package/lib/components/tabs.js +523 -492
  43. package/lib/components/tag.d.ts +1 -1
  44. package/lib/components/tag.js +236 -235
  45. package/lib/components/textarea.d.ts +1 -1
  46. package/lib/components/textarea.js +457 -456
  47. package/lib/components/tooltip.js +283 -283
  48. package/lib/components/wizard.js +384 -384
  49. package/lib/icons/heroicons/micro.js +392 -392
  50. package/lib/icons/heroicons/mini.js +382 -382
  51. package/lib/icons/heroicons/outline.js +337 -337
  52. package/lib/icons/heroicons/solid.js +407 -407
  53. package/lib/icons/lucide.js +22843 -22843
  54. package/lib/icons/material/filled.js +9653 -9653
  55. package/lib/icons/material/outlined.js +10271 -10271
  56. package/lib/icons/material/round.js +10495 -10495
  57. package/lib/icons/material/sharp.js +9905 -9905
  58. package/lib/icons/material/two-tone.js +12792 -12792
  59. package/lib/index.js +21 -21
  60. package/lib/styles/button.js +200 -302
  61. package/lib/styles/calendar-month.js +123 -183
  62. package/lib/styles/calendar-navigation.d.ts +1 -1
  63. package/lib/styles/calendar-navigation.js +64 -79
  64. package/lib/styles/calendar.d.ts +1 -1
  65. package/lib/styles/calendar.js +9 -9
  66. package/lib/styles/checkbox.js +45 -72
  67. package/lib/styles/copy.js +67 -91
  68. package/lib/styles/custom-scrollbar.js +80 -100
  69. package/lib/styles/date-picker.js +261 -331
  70. package/lib/styles/field-size.d.ts +6 -0
  71. package/lib/styles/field-size.js +91 -0
  72. package/lib/styles/file-upload.js +139 -169
  73. package/lib/styles/icon.js +92 -156
  74. package/lib/styles/input.js +125 -241
  75. package/lib/styles/modal.js +67 -102
  76. package/lib/styles/option.d.ts +1 -1
  77. package/lib/styles/option.js +47 -67
  78. package/lib/styles/popup.js +34 -65
  79. package/lib/styles/radio.js +69 -96
  80. package/lib/styles/resize-observer.js +2 -5
  81. package/lib/styles/scroll-container.js +100 -130
  82. package/lib/styles/select-base.js +596 -773
  83. package/lib/styles/select.js +140 -228
  84. package/lib/styles/step.js +22 -29
  85. package/lib/styles/switch.js +34 -55
  86. package/lib/styles/tab.d.ts +1 -1
  87. package/lib/styles/tab.js +22 -29
  88. package/lib/styles/tabs.d.ts +1 -1
  89. package/lib/styles/tabs.js +186 -180
  90. package/lib/styles/tag.js +135 -188
  91. package/lib/styles/textarea.d.ts +1 -1
  92. package/lib/styles/textarea.js +205 -271
  93. package/lib/styles/tooltip.js +3 -3
  94. package/lib/styles/wizard.js +170 -226
  95. package/lib/types/common.d.ts +2 -0
  96. package/lib/types/common.js +6 -5
  97. package/lib/utils/calendar-utils.js +100 -100
  98. package/lib/utils/custom-scrollbar.js +272 -272
  99. package/lib/utils/flavor-sheet.js +14 -14
  100. package/lib/utils/icon-registry.js +127 -127
  101. package/lib/utils/loader-registry.js +3 -3
  102. package/lib/utils/locale.js +34 -34
  103. package/lib/utils/mobile.js +1 -1
  104. package/lib/utils/number-format.js +54 -54
  105. package/lib/utils/positioning.js +212 -212
  106. package/lib/utils/property-capture.js +36 -36
  107. package/lib/utils/property-manager.js +125 -125
  108. package/lib/utils/resize-observer.js +23 -23
  109. package/lib/utils/scroll-lock.js +57 -57
  110. package/lib/utils/styles.js +17 -17
  111. package/lib/version.d.ts +1 -1
  112. package/lib/version.js +1 -1
  113. package/package.json +4 -4
@@ -1,94 +1,74 @@
1
1
  export const optionStyles = `
2
2
  .option-content {
3
- display: flex;
4
- align-items: center;
5
- justify-content: space-between;
6
- gap: var(--ty-spacing-2);
7
- box-sizing: border-box;
8
- width: 100%;
9
-
10
- cursor: pointer;
11
- user-select: none;
12
-
13
- transition: var(--ty-transition-all);
14
-
15
- /* Linear-paired typography */
16
- color: var(--ty-text);
17
- font-family: inherit;
18
- font-size: var(--ty-font-sm);
19
- line-height: var(--ty-leading-sm);
20
- letter-spacing: var(--ty-tracking-sm);
21
- padding: var(--ty-spacing-2) var(--ty-spacing-3);
22
- border-radius: var(--ty-radius-md);
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: space-between;
6
+ gap: var(--ty-spacing-2);
7
+ box-sizing: border-box;
8
+ width: 100%;
9
+ cursor: pointer;
10
+ user-select: none;
11
+ transition: var(--ty-transition-all);
12
+ color: var(--ty-text);
13
+ font-family: inherit;
14
+ font-size: var(--ty-font-sm);
15
+ line-height: var(--ty-leading-sm);
16
+ letter-spacing: var(--ty-tracking-sm);
17
+ padding: var(--ty-spacing-2) var(--ty-spacing-3);
18
+ border-radius: var(--ty-radius-md);
23
19
  }
24
-
25
- /* Cloned copy (projected into the select's trigger field): host defaults to
26
- inline like any unstyled custom element, which ignores width/overflow —
27
- force a block box so the parent's flex-basis:0 truncation (select.ts
28
- .select-stub.has-clone slot[name="selected"]) actually clips it, and
29
- collapse the content to a single ellipsized line instead of wrapping. */
30
20
  :host([cloned]) {
31
- display: block;
32
- min-width: 0;
33
- overflow: hidden;
21
+ display: block;
22
+ min-width: 0;
23
+ overflow: hidden;
34
24
  }
35
25
  :host([cloned]) .option-content {
36
- display: block;
37
- padding: 0px;
38
- background: transparent;
39
- min-width: 0;
40
- overflow: hidden;
41
- white-space: nowrap;
42
- text-overflow: ellipsis;
26
+ display: block;
27
+ padding: 0px;
28
+ background: transparent;
29
+ min-width: 0;
30
+ overflow: hidden;
31
+ white-space: nowrap;
32
+ text-overflow: ellipsis;
33
+ font-size: var(--ty-field-font, var(--ty-font-sm));
34
+ line-height: var(--ty-field-leading, var(--ty-leading-sm));
35
+ letter-spacing: var(--ty-field-tracking, var(--ty-tracking-sm));
43
36
  }
44
-
45
37
  .option-content:hover {
46
- background: var(--ty-bg-neutral-soft);
38
+ background: var(--ty-bg-neutral-soft);
47
39
  }
48
-
49
40
  .option-content[highlighted] {
50
- background: var(--ty-bg-neutral-soft);
51
- color: var(--ty-text-strong);
52
- font-weight: var(--ty-font-semibold);
41
+ background: var(--ty-bg-neutral-soft);
42
+ color: var(--ty-text-strong);
43
+ font-weight: var(--ty-font-semibold);
53
44
  }
54
-
55
- /* Selected: quiet — bolder text color only, no background slab, no weight change */
56
45
  .option-content[selected] {
57
- background: transparent;
58
- color: var(--ty-text-bold);
46
+ background: transparent;
47
+ color: var(--ty-text-bold);
59
48
  }
60
-
61
- /* Lucide check — right-aligned, visible only on selected options */
62
49
  .option-check {
63
- display: none;
64
- flex-shrink: 0;
65
- width: 14px;
66
- height: 14px;
67
- margin-left: auto;
68
- color: var(--ty-color-primary);
50
+ display: none;
51
+ flex-shrink: 0;
52
+ width: 14px;
53
+ height: 14px;
54
+ margin-left: auto;
55
+ color: var(--ty-color-primary);
69
56
  }
70
-
71
57
  .option-content[selected] .option-check {
72
- display: block;
58
+ display: block;
73
59
  }
74
-
75
- /* Never show the check on the copy cloned into the select's trigger field */
76
60
  :host([cloned]) .option-check {
77
- display: none;
61
+ display: none;
78
62
  }
79
-
80
63
  .option-content[selected]:hover {
81
- background: var(--ty-bg-neutral-soft);
64
+ background: var(--ty-bg-neutral-soft);
82
65
  }
83
-
84
66
  .option-content[disabled] {
85
- opacity: 0.5;
86
- cursor: not-allowed;
67
+ opacity: 0.5;
68
+ cursor: not-allowed;
87
69
  }
88
-
89
70
  .option-content[hidden] {}
90
-
91
71
  .option-content * {
92
- pointer-events: none;
72
+ pointer-events: none;
93
73
  }
94
74
  `;
@@ -1,91 +1,60 @@
1
1
  export const popupStyles = `
2
2
  .popup-dialog {
3
- position: fixed;
4
- top: 0;
5
- left: 0;
6
-
7
- /* Reset dialog defaults */
8
- margin: 0;
9
- border: none;
10
- background: transparent;
11
- max-width: none;
12
- max-height: none;
13
-
14
- /* Shadow infrastructure - provide space for user shadows */
15
- padding: var(--popup-padding, 16px);
16
-
17
- /* Hidden by default - even when [open] (for positioning phase) */
18
- visibility: hidden;
19
- opacity: 0;
20
- /* NO TRANSFORM here - apply only when animating to avoid measurement errors! */
21
-
22
- transition:
23
- opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
24
- visibility var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
25
- transform var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
26
-
27
- /* Prevent interactions when hidden */
28
- pointer-events: none;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ margin: 0;
7
+ border: none;
8
+ background: transparent;
9
+ max-width: none;
10
+ max-height: none;
11
+ padding: var(--popup-padding, 16px);
12
+ visibility: hidden;
13
+ opacity: 0;
14
+ transition:
15
+ opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
16
+ visibility var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
17
+ transform var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
18
+ pointer-events: none;
29
19
  }
30
-
31
- /* Apply position variables only when position is calculated (like dropdown) */
32
20
  .popup-dialog.position-calculated {
33
- top: var(--popup-y, 0px);
34
- left: var(--popup-x, 0px);
21
+ top: var(--popup-y, 0px);
22
+ left: var(--popup-x, 0px);
35
23
  }
36
-
37
- /* Entrance prep (right before .open): scale + a short slide from the anchor
38
- side. data-side is the RESOLVED side (post-flip), set by updatePosition. */
39
24
  .popup-dialog.preparing-animation {
40
- transform: scale(0.96);
25
+ transform: scale(0.96);
41
26
  }
42
-
43
27
  .popup-dialog[data-side="bottom"].preparing-animation:not(.open) {
44
- transform: translateY(-6px) scale(0.96);
28
+ transform: translateY(-6px) scale(0.96);
45
29
  }
46
-
47
30
  .popup-dialog[data-side="top"].preparing-animation:not(.open) {
48
- transform: translateY(6px) scale(0.96);
31
+ transform: translateY(6px) scale(0.96);
49
32
  }
50
-
51
33
  .popup-dialog[data-side="left"].preparing-animation:not(.open) {
52
- transform: translateX(6px) scale(0.96);
34
+ transform: translateX(6px) scale(0.96);
53
35
  }
54
-
55
36
  .popup-dialog[data-side="right"].preparing-animation:not(.open) {
56
- transform: translateX(-6px) scale(0.96);
37
+ transform: translateX(-6px) scale(0.96);
57
38
  }
58
-
59
39
  .popup-dialog.open {
60
- visibility: visible;
61
- opacity: 1;
62
- transform: scale(1);
63
- pointer-events: auto;
40
+ visibility: visible;
41
+ opacity: 1;
42
+ transform: scale(1);
43
+ pointer-events: auto;
64
44
  }
65
-
66
- /* Make dialog backdrop transparent like dropdown/date-picker */
67
45
  .popup-dialog::backdrop {
68
- background: transparent;
46
+ background: transparent;
69
47
  }
70
-
71
- /* Neutral structural container — users control all visuals via slotted content */
72
48
  .popup-container {
73
- display: contents;
49
+ display: contents;
74
50
  }
75
-
76
- /* Slotted content defines its own styling */
77
51
  #popup-content {
78
- display: contents;
52
+ display: contents;
79
53
  }
80
-
81
- /* Users have complete control over the popup's appearance; only essential
82
- positioning is imposed here. */
83
54
  #popup-content ::slotted(*) {
84
- position: relative;
85
-
86
- /* Prevent content from being too wide - still helpful */
87
- max-width: min(400px, 90vw);
88
- max-height: min(500px, 80vh);
89
- overflow: auto;
55
+ position: relative;
56
+ max-width: min(400px, 90vw);
57
+ max-height: min(500px, 80vh);
58
+ overflow: auto;
90
59
  }
91
60
  `;
@@ -1,10 +1,10 @@
1
1
  import { FLAVORS } from "../types/common.js";
2
2
  import { inputStyles } from "./input.js";
3
3
  const radioFlavor = (f, fb) => {
4
- const tok = (s) => fb
5
- ? `var(--ty-color-${f}${s}, var(--ty-color-${fb}${s}))`
6
- : `var(--ty-color-${f}${s})`;
7
- return `
4
+ const tok = (s) => fb
5
+ ? `var(--ty-color-${f}${s}, var(--ty-color-${fb}${s}))`
6
+ : `var(--ty-color-${f}${s})`;
7
+ return `
8
8
  :host([flavor="${f}"]) { --radio-color: ${tok("")}; }
9
9
  :host([flavor="${f}+"]) { --radio-color: ${tok("-strong")}; }
10
10
  :host([flavor="${f}-"]) { --radio-color: ${tok("-soft")}; }
@@ -13,137 +13,110 @@ const radioFlavor = (f, fb) => {
13
13
  export const radioCustomFlavorCss = (base) => radioFlavor(base, "neutral");
14
14
  export const radioStyles = `
15
15
  ${inputStyles}
16
-
17
- /* Override input's :host. ty-radio is just the circle (inline);
18
- ty-radio-group is a form-field block. */
19
16
  :host(ty-radio) {
20
- display: inline-flex;
21
- width: auto;
22
- vertical-align: middle;
17
+ display: inline-flex;
18
+ width: auto;
19
+ vertical-align: middle;
23
20
  }
24
-
25
21
  :host(ty-radio-group) {
26
- display: block;
27
- width: 100%;
22
+ display: block;
23
+ width: 100%;
28
24
  }
29
-
30
25
  .radio-group-container {
31
- display: flex;
32
- flex-direction: column;
33
- gap: 0.4rem;
34
- font-family: inherit;
35
- color: var(--ty-color-text);
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 0.4rem;
29
+ font-family: inherit;
30
+ color: var(--ty-color-text);
36
31
  }
37
-
38
32
  .radio-group-label {
39
- font-size: var(--ty-font-sm);
40
- line-height: var(--ty-leading-sm);
41
- font-weight: var(--ty-font-medium);
42
- color: var(--ty-color-text);
43
- display: flex;
44
- align-items: center;
45
- gap: 0.25rem;
46
- }
47
-
33
+ font-size: var(--ty-font-sm);
34
+ line-height: var(--ty-leading-sm);
35
+ font-weight: var(--ty-font-medium);
36
+ color: var(--ty-color-text);
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 0.25rem;
40
+ }
48
41
  .radio-group-list {
49
- display: flex;
50
- gap: 0.6rem;
51
- align-items: flex-start;
42
+ display: flex;
43
+ gap: 0.6rem;
44
+ align-items: flex-start;
52
45
  }
53
-
54
46
  .radio-group-list.vertical {
55
- flex-direction: column;
56
- align-items: flex-start;
47
+ flex-direction: column;
48
+ align-items: flex-start;
57
49
  }
58
-
59
50
  .radio-group-list.horizontal {
60
- flex-direction: row;
61
- flex-wrap: wrap;
62
- align-items: center;
51
+ flex-direction: row;
52
+ flex-wrap: wrap;
53
+ align-items: center;
63
54
  }
64
-
65
55
  .radio-group-error {
66
- font-size: var(--ty-font-xs);
67
- line-height: var(--ty-leading-xs);
68
- color: var(--ty-color-danger);
56
+ font-size: var(--ty-font-xs);
57
+ line-height: var(--ty-leading-xs);
58
+ color: var(--ty-color-danger);
69
59
  }
70
-
71
60
  .radio-group-container .required-icon {
72
- width: 0.65em;
73
- height: 0.65em;
74
- color: var(--ty-color-danger);
61
+ width: 0.65em;
62
+ height: 0.65em;
63
+ color: var(--ty-color-danger);
75
64
  }
76
65
  .radio-group-container .required-icon svg {
77
- width: 100%;
78
- height: 100%;
66
+ width: 100%;
67
+ height: 100%;
79
68
  }
80
-
81
- /* A radio item is just the circle */
82
69
  .radio-container {
83
- display: inline-block;
84
- cursor: pointer;
85
- user-select: none;
86
- outline: none;
87
- vertical-align: middle;
70
+ display: inline-block;
71
+ cursor: pointer;
72
+ user-select: none;
73
+ outline: none;
74
+ vertical-align: middle;
88
75
  }
89
-
90
76
  .radio-container.disabled {
91
- cursor: not-allowed;
92
- opacity: 0.55;
77
+ cursor: not-allowed;
78
+ opacity: 0.55;
93
79
  }
94
-
95
80
  .radio-container:focus-visible .radio-circle,
96
81
  .radio-container.focused .radio-circle {
97
- box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
82
+ box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
98
83
  }
99
-
100
84
  .radio-circle {
101
- position: relative;
102
- flex-shrink: 0;
103
- width: 18px;
104
- height: 18px;
105
- border-radius: 50%;
106
- border: 2px solid var(--ty-input-border);
107
- background: var(--ty-input-bg);
108
- box-sizing: border-box;
109
- transition: var(--ty-local-transition, border-color 0.15s ease-in-out);
110
- }
111
-
112
- /* Default (no flavor attribute) is primary — defaults don't reflect to the
113
- host attribute, so the base rules' fallback carries the default look. */
85
+ position: relative;
86
+ flex-shrink: 0;
87
+ width: 18px;
88
+ height: 18px;
89
+ border-radius: 50%;
90
+ border: 2px solid var(--ty-input-border);
91
+ background: var(--ty-input-bg);
92
+ box-sizing: border-box;
93
+ transition: var(--ty-local-transition, border-color 0.15s ease-in-out);
94
+ }
114
95
  .radio-circle::after {
115
- content: "";
116
- position: absolute;
117
- top: 50%;
118
- left: 50%;
119
- width: 8px;
120
- height: 8px;
121
- border-radius: 50%;
122
- background: var(--radio-color, var(--ty-color-primary));
123
- transform: translate(-50%, -50%) scale(0);
124
- transition: transform 0.15s ease-in-out;
125
- }
126
-
96
+ content: "";
97
+ position: absolute;
98
+ top: 50%;
99
+ left: 50%;
100
+ width: 8px;
101
+ height: 8px;
102
+ border-radius: 50%;
103
+ background: var(--radio-color, var(--ty-color-primary));
104
+ transform: translate(-50%, -50%) scale(0);
105
+ transition: transform 0.15s ease-in-out;
106
+ }
127
107
  .radio-container[aria-checked="true"] .radio-circle {
128
- border-color: var(--radio-color, var(--ty-color-primary));
108
+ border-color: var(--radio-color, var(--ty-color-primary));
129
109
  }
130
-
131
110
  .radio-container[aria-checked="true"] .radio-circle::after {
132
- transform: translate(-50%, -50%) scale(1);
111
+ transform: translate(-50%, -50%) scale(1);
133
112
  }
134
-
135
113
  .radio-container.xs .radio-circle { width: 14px; height: 14px; }
136
114
  .radio-container.xs .radio-circle::after { width: 6px; height: 6px; }
137
-
138
115
  .radio-container.sm .radio-circle { width: 16px; height: 16px; }
139
116
  .radio-container.sm .radio-circle::after { width: 7px; height: 7px; }
140
-
141
117
  .radio-container.lg .radio-circle { width: 22px; height: 22px; }
142
118
  .radio-container.lg .radio-circle::after { width: 10px; height: 10px; }
143
-
144
119
  .radio-container.xl .radio-circle { width: 26px; height: 26px; }
145
120
  .radio-container.xl .radio-circle::after { width: 12px; height: 12px; }
146
-
147
- /* Flavor variants — set --radio-color, consumed by the base rules above */
148
121
  ${FLAVORS.map((f) => radioFlavor(f)).join("")}
149
122
  `;
@@ -1,11 +1,8 @@
1
1
  export const resizeObserverStyles = `
2
2
  :host {
3
- /* Default to block display, user can override */
4
- display: block;
5
- position: relative;
3
+ display: block;
4
+ position: relative;
6
5
  }
7
-
8
6
  ::slotted(*) {
9
- /* No default styling - preserve natural layout */
10
7
  }
11
8
  `;