@mt-gloss/styles 0.0.3

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 ADDED
@@ -0,0 +1,23 @@
1
+ # @mt-gloss/styles
2
+
3
+ SCSS mixins, base styles, and component styles for MarketTime UI components.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @mt-gloss/styles @mt-gloss/tokens
9
+ ```
10
+
11
+ ## Peer Dependencies
12
+
13
+ - @mt-gloss/tokens ^0.1.0
14
+
15
+ ## Usage
16
+
17
+ Import in your SCSS:
18
+
19
+ ```scss
20
+ @use '@mt-gloss/styles/src/index' as *;
21
+ ```
22
+
23
+ Or configure your Vite/webpack SCSS preprocessor to load the entry point.
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@mt-gloss/styles",
3
+ "version": "0.0.3",
4
+ "type": "module",
5
+ "files": [
6
+ "src/**/*.scss"
7
+ ],
8
+ "sideEffects": [
9
+ "**/*.scss"
10
+ ],
11
+ "peerDependencies": {
12
+ "@mt-gloss/tokens": ">=0.0.1"
13
+ }
14
+ }
package/src/index.scss ADDED
@@ -0,0 +1,35 @@
1
+ // ============================================
2
+ // GLOSS UI KIT v4.4 — MAIN ENTRY POINT
3
+ // ============================================
4
+
5
+ // Foundations
6
+ @use '../../tokens/src/tokens' as *;
7
+ @use './lib/mixins' as *;
8
+ @use '../../tokens/src/root';
9
+ @forward '../../tokens/src/tokens';
10
+ @forward './lib/mixins';
11
+ @forward './lib/base';
12
+
13
+ // Components
14
+ @forward './lib/components/buttons';
15
+ @forward './lib/components/inputs';
16
+ @forward './lib/components/cards';
17
+ @forward './lib/components/dropdowns';
18
+ @forward './lib/components/select';
19
+ @forward './lib/components/selection';
20
+ @forward './lib/components/feedback';
21
+ @forward './lib/components/async';
22
+ @forward './lib/components/accordion';
23
+ @forward './lib/components/tooltip';
24
+ @forward './lib/components/textarea';
25
+ @forward './lib/components/animations';
26
+ @forward './lib/components/form';
27
+ @forward './lib/components/links';
28
+ @forward './lib/components/segmented-control';
29
+ @forward './lib/components/slider';
30
+ @forward './lib/components/composed-inputs';
31
+ @forward './lib/components/datepicker';
32
+ @forward './lib/components/specialized';
33
+ @forward './lib/components/badge';
34
+ @forward './lib/components/chips';
35
+ @forward './lib/components/menu';
@@ -0,0 +1,27 @@
1
+ // ============================================
2
+ // GLOSS UI KIT v4.4 — BASE & RESET
3
+ // ============================================
4
+
5
+ @use '../../../tokens/src/tokens' as *;
6
+
7
+ // Google Fonts
8
+ @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
9
+
10
+ // --- RESET ---
11
+ *, *::before, *::after {
12
+ box-sizing: border-box;
13
+ margin: 0;
14
+ padding: 0;
15
+ }
16
+
17
+ html {
18
+ scroll-behavior: smooth;
19
+ font-size: 16px;
20
+ }
21
+
22
+ body {
23
+ font-family: $font-body;
24
+ background: $alias-bg-page;
25
+ color: $alias-text-primary;
26
+ line-height: 1.5;
27
+ }
@@ -0,0 +1,93 @@
1
+ @use '../../../tokens/src/tokens' as *;
2
+
3
+ // ============================================
4
+ // DASHBOARD TOKEN BRIDGE
5
+ // ============================================
6
+ // Maps CSS custom properties used by dashboard components
7
+ // to gloss-styles token values (or hardcoded dashboard originals).
8
+ //
9
+ // Usage: @import '@mt-gloss/styles/dashboard-bridge';
10
+ // or: @use './dashboard-bridge';
11
+ //
12
+ // Dashboard components use var(--token, fallback) inline.
13
+ // This bridge provides the canonical values.
14
+ // Components degrade gracefully without it via their fallbacks.
15
+ //
16
+ // Token audit:
17
+ // ~30 tokens map directly to gloss-styles SCSS variables
18
+ // ~20 tokens are net-new (marked /* NEW */) — candidates for
19
+ // future absorption into the core token system
20
+ // ============================================
21
+
22
+ :root {
23
+ // ---- Color: Interactive ----
24
+ --color-interactive: #4f46e5; /* NOTE: dashboard indigo-600, differs from $alias-primary (#2563eb blue-600) */
25
+ --color-interactive-pressed: #4338ca; /* NOTE: dashboard indigo-700, differs from $alias-primary-active (#1e40af blue-800) */
26
+
27
+ // ---- Color: Semantic ----
28
+ --color-positive: #{$color-green-500}; /* maps to: $color-green-500 (#22c55e) */
29
+ --color-negative: #{$color-red-500}; /* maps to: $color-red-500 (#ef4444) */
30
+ --color-warning: #{$color-amber-500}; /* maps to: $color-amber-500 (#f59e0b) */
31
+
32
+ // ---- Color: Text (5) ----
33
+ --color-text-primary: #{$color-gray-700}; /* maps to: $color-gray-700 (#374151) */
34
+ --color-text-secondary: #{$color-gray-500}; /* maps to: $color-gray-500 (#6b7280) */
35
+ --color-text-strong: #{$color-gray-900}; /* maps to: $color-gray-900 (#111827) */
36
+ --color-text-muted: #{$color-gray-400}; /* maps to: $color-gray-400 (#9ca3af) */
37
+ --color-text-placeholder: #{$color-gray-300}; /* maps to: $color-gray-300 (#d1d5db) */
38
+
39
+ // ---- Color: Surface (3) ----
40
+ --color-surface-primary: #{$color-white}; /* maps to: $color-white (#ffffff) */
41
+ --color-surface-secondary: #{$color-gray-50}; /* maps to: $color-gray-50 (#f9fafb) */
42
+ --color-surface-tertiary: #{$color-gray-100}; /* maps to: $color-gray-100 (#f3f4f6) */
43
+
44
+ // ---- Color: Border (2) ----
45
+ --color-border-subtle: #{$color-gray-200}; /* maps to: $color-gray-200 (#e5e7eb) */
46
+ --color-border-default: #{$color-gray-300}; /* maps to: $color-gray-300 (#d1d5db) */
47
+
48
+ // ---- Color: Overlay (4) ----
49
+ --overlay-light: rgba(0, 0, 0, 0.04); /* NEW: no gloss-styles equivalent */
50
+ --overlay-subtle: rgba(0, 0, 0, 0.06); /* NEW: no gloss-styles equivalent */
51
+ --overlay-border-light: rgba(0, 0, 0, 0.05); /* NEW: no gloss-styles equivalent */
52
+ --card-border: 1px solid rgba(0, 0, 0, 0.08); /* NEW: no gloss-styles equivalent */
53
+
54
+ // ---- Typography (9) ----
55
+ --font-sans: #{$font-body}; /* maps to: $font-body ('Plus Jakarta Sans', sans-serif) */
56
+ --font-chrome: #{$font-body}; /* maps to: $font-body */
57
+ --font-medium: 500; /* NEW: no gloss-styles equivalent (font weight) */
58
+ --font-normal: 400; /* NEW: no gloss-styles equivalent (font weight) */
59
+ --text-xs: #{$text-xs}; /* maps to: $text-xs (0.6875rem) */
60
+ --text-sm: #{$text-sm}; /* maps to: $text-sm (0.8125rem) */
61
+ --text-base: #{$text-base}; /* maps to: $text-base (0.9375rem) */
62
+ --tracking-tight: -0.01em; /* NEW: no gloss-styles equivalent (letter-spacing) */
63
+ --tracking-wider: 0.05em; /* NEW: no gloss-styles equivalent (letter-spacing) */
64
+
65
+ // ---- Shadow (2) ----
66
+ --shadow-card: #{$shadow-card}; /* maps to: $shadow-card */
67
+ --shadow-card-hover: #{$shadow-elevation-hover}; /* maps to: $shadow-elevation-hover */
68
+
69
+ // ---- Radius (2) ----
70
+ --radius-lg: 12px; /* NOTE: dashboard original 12px, differs from $radius-lg (14px) */
71
+ --radius-sm: #{$radius-xs}; /* maps to: $radius-xs (4px) — NOTE: name mismatch, dashboard --radius-sm = gloss $radius-xs */
72
+
73
+ // ---- Skeleton (7) ----
74
+ --skeleton-base: #{$color-gray-200}; /* maps to: $color-gray-200 (#e5e7eb) */
75
+ --skeleton-header-base: #{$color-gray-300}; /* maps to: $color-gray-300 (#d1d5db) */
76
+ --skeleton-radius: #{$radius-sm}; /* maps to: $radius-sm (6px) */
77
+ --skeleton-breathe-duration: 2s; /* NEW: no gloss-styles equivalent (animation) */
78
+ --skeleton-fade-duration: 150ms; /* NEW: no gloss-styles equivalent (animation) */
79
+ --skeleton-progress-height: 2px; /* NEW: no gloss-styles equivalent */
80
+ --skeleton-progress-color: var(--color-interactive); /* NEW: references --color-interactive above */
81
+
82
+ // ---- Table (2) ----
83
+ --table-row-divider: #{$color-gray-100}; /* maps to: $color-gray-100 (#f3f4f6) */
84
+ --table-row-hover-bg: rgba(0, 0, 0, 0.02); /* NEW: no gloss-styles equivalent */
85
+
86
+ // ---- Chip (6) ----
87
+ --chip-bg: rgba(0, 0, 0, 0.08); /* NEW: no gloss-styles equivalent */
88
+ --chip-bg-hover: rgba(0, 0, 0, 0.12); /* NEW: no gloss-styles equivalent */
89
+ --chip-text: rgba(0, 0, 0, 0.87); /* NEW: no gloss-styles equivalent */
90
+ --chip-radius: 16px; /* NOTE: dashboard original 16px, differs from $radius-full (9999px) */
91
+ --chip-height: 28px; /* NEW: no gloss-styles equivalent */
92
+ --chip-padding-x: 10px; /* NEW: no gloss-styles equivalent */
93
+ }
@@ -0,0 +1,80 @@
1
+ // ============================================
2
+ // GLOSS UI KIT v4.4 — MIXINS
3
+ // ============================================
4
+
5
+ @use '../../../tokens/src/tokens' as *;
6
+
7
+ // --- TRANSITION CHOREOGRAPHY ---
8
+ // These mixins define the specific timing and delays that create
9
+ // the "choreographed motion" effect where borders react instantly
10
+ // and shadows follow with a slight delay
11
+
12
+ @mixin input-transition-hover {
13
+ transition: border-color 0.1s ease-out, box-shadow 0.1s ease-out, background 0.2s ease;
14
+ }
15
+
16
+ @mixin input-transition-focus {
17
+ transition: border-color 0.1s ease-out, box-shadow 0.2s ease-out 0.1s, background 0.2s ease;
18
+ }
19
+
20
+ @mixin input-transition-default {
21
+ transition:
22
+ border-color 0.2s ease-out 0.1s,
23
+ box-shadow 0.1s ease-out,
24
+ background 0.2s ease;
25
+ }
26
+
27
+ @mixin button-transition {
28
+ transition: transform 200ms ease-out, box-shadow 200ms ease-out, background 100ms;
29
+ }
30
+
31
+ // --- PHYSICS (SHADOW MIXINS) ---
32
+ // Apply consistent shadow patterns for depth hierarchy
33
+
34
+ @mixin shadow-input-default {
35
+ box-shadow: $shadow-input-default;
36
+ }
37
+
38
+ @mixin shadow-input-focus {
39
+ box-shadow: $shadow-input-focus;
40
+ }
41
+
42
+ @mixin shadow-elevation-hover {
43
+ box-shadow: $shadow-elevation-hover;
44
+ }
45
+
46
+ @mixin shadow-button-default {
47
+ box-shadow: $shadow-button-default;
48
+ }
49
+
50
+ @mixin shadow-button-hover {
51
+ box-shadow: $shadow-button-hover;
52
+ }
53
+
54
+ @mixin shadow-button-active {
55
+ box-shadow: $shadow-button-active;
56
+ }
57
+
58
+ @mixin shadow-card {
59
+ box-shadow: $shadow-card;
60
+ }
61
+
62
+ // --- KEYFRAME ANIMATIONS ---
63
+ @keyframes spinner {
64
+ to { transform: rotate(360deg); }
65
+ }
66
+
67
+ @keyframes slideDown {
68
+ from { opacity: 0; transform: translateY(-10px); }
69
+ to { opacity: 1; transform: translateY(0); }
70
+ }
71
+
72
+ @keyframes slideDownFade {
73
+ from { opacity: 0; transform: translateY(-4px); }
74
+ to { opacity: 1; transform: translateY(0); }
75
+ }
76
+
77
+ @keyframes dash-rotate {
78
+ 0% { stroke-dashoffset: 400; }
79
+ 100% { stroke-dashoffset: 0; }
80
+ }
@@ -0,0 +1,4 @@
1
+ // Token forwarder — canonical source is now libs/tokens/src/_tokens.scss
2
+ // This file exists so component SCSS files within gloss-styles can continue
3
+ // to @use './tokens' or @use '../tokens' without path changes.
4
+ @forward '../../../tokens/src/tokens';
@@ -0,0 +1,236 @@
1
+ // ============================================
2
+ // COMPONENT: ACCORDION / DETAILS
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+ @use '../mixins' as *;
7
+
8
+ .gloss-details {
9
+ margin-bottom: $space-4;
10
+ background: $alias-bg-surface;
11
+ border: 1px solid $alias-border-default;
12
+ border-radius: $radius-lg;
13
+ overflow: hidden;
14
+ transition: all 0.2s;
15
+
16
+ &[open] {
17
+ box-shadow: $shadow-card;
18
+ border-color: $color-blue-200;
19
+
20
+ .gloss-details__summary {
21
+ color: $alias-primary;
22
+ background: $alias-bg-muted;
23
+ border-bottom: 1px solid $alias-border-default;
24
+
25
+ &::after {
26
+ content: '−';
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ .gloss-details__summary {
33
+ padding: $space-4 $space-6;
34
+ cursor: pointer;
35
+ list-style: none;
36
+ font-family: $font-display;
37
+ font-size: $text-lg;
38
+ color: $alias-text-primary;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: space-between;
42
+
43
+ &::-webkit-details-marker {
44
+ display: none;
45
+ }
46
+
47
+ &::after {
48
+ content: '+';
49
+ font-family: $font-body;
50
+ font-weight: 400;
51
+ font-size: 1.5rem;
52
+ color: $alias-text-tertiary;
53
+ }
54
+ }
55
+
56
+ .gloss-details__content {
57
+ padding: $space-6;
58
+ display: flex;
59
+ gap: $space-6;
60
+ align-items: flex-start;
61
+ }
62
+
63
+ // ============================================
64
+ // REACT ACCORDION COMPONENT
65
+ // ============================================
66
+
67
+ // Animation variables
68
+ $accordion-duration: 200ms;
69
+ $accordion-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275); // Spring easing
70
+ $accordion-easing-out: cubic-bezier(0, 0, 0.2, 1);
71
+
72
+ // --- ACCORDION CONTAINER ---
73
+ .gloss-accordion {
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: $space-1;
77
+ }
78
+
79
+ // --- ACCORDION ITEM ---
80
+ .gloss-accordion-item {
81
+ display: flex;
82
+ flex-direction: column;
83
+
84
+ &--disabled {
85
+ opacity: 0.5;
86
+ pointer-events: none;
87
+ }
88
+ }
89
+
90
+ // --- ACCORDION TRIGGER ---
91
+ .gloss-accordion-trigger {
92
+ display: flex;
93
+ align-items: center;
94
+ width: 100%;
95
+ padding: $space-3 $space-4;
96
+ background: transparent;
97
+ border: none;
98
+ border-radius: $radius-sm;
99
+ cursor: pointer;
100
+ font-family: $font-body;
101
+ font-size: $text-sm;
102
+ font-weight: 600;
103
+ color: $alias-text-primary;
104
+ text-align: left;
105
+ transition:
106
+ background-color 150ms $accordion-easing-out,
107
+ transform 100ms $accordion-easing;
108
+
109
+ &:hover:not(:disabled) {
110
+ background-color: $color-gray-50;
111
+ }
112
+
113
+ &:focus-visible {
114
+ outline: 2px solid $alias-border-focus;
115
+ outline-offset: 2px;
116
+ }
117
+
118
+ &:active:not(:disabled) {
119
+ transform: scale(0.98);
120
+ }
121
+
122
+ &:disabled {
123
+ cursor: not-allowed;
124
+ opacity: 0.5;
125
+ }
126
+
127
+ // Icon slot (left)
128
+ &__icon {
129
+ display: flex;
130
+ align-items: center;
131
+ justify-content: center;
132
+ margin-right: $space-3;
133
+ color: $alias-text-secondary;
134
+ flex-shrink: 0;
135
+
136
+ svg {
137
+ width: 18px;
138
+ height: 18px;
139
+ }
140
+ }
141
+
142
+ // Label
143
+ &__label {
144
+ flex: 1;
145
+ min-width: 0;
146
+ overflow: hidden;
147
+ text-overflow: ellipsis;
148
+ white-space: nowrap;
149
+ }
150
+
151
+ // Right-aligned container (count or chevron)
152
+ &__end {
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ margin-left: auto;
157
+ flex-shrink: 0;
158
+ }
159
+
160
+ // Count badge
161
+ &__count {
162
+ display: inline-flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ min-width: 20px;
166
+ height: 20px;
167
+ padding: 0 $space-2;
168
+ background: $color-gray-800;
169
+ color: $color-white;
170
+ font-size: $text-xs;
171
+ font-weight: 600;
172
+ border-radius: $radius-full;
173
+ animation: accordion-count-in 150ms $accordion-easing-out forwards;
174
+ }
175
+
176
+ // Chevron icon
177
+ &__chevron {
178
+ display: flex;
179
+ align-items: center;
180
+ justify-content: center;
181
+ color: $alias-text-secondary;
182
+ transition: transform $accordion-duration $accordion-easing-out;
183
+
184
+ svg {
185
+ width: 16px;
186
+ height: 16px;
187
+ }
188
+ }
189
+ }
190
+
191
+ // --- ACCORDION CONTENT ---
192
+ .gloss-accordion-content {
193
+ display: grid;
194
+ grid-template-rows: 0fr;
195
+ opacity: 0;
196
+ transition:
197
+ grid-template-rows $accordion-duration $accordion-easing,
198
+ opacity 150ms $accordion-easing-out;
199
+
200
+ &--expanded {
201
+ grid-template-rows: 1fr;
202
+ opacity: 1;
203
+ }
204
+
205
+ &__inner {
206
+ overflow: hidden;
207
+ }
208
+ }
209
+
210
+ // --- OPEN STATE MODIFIERS ---
211
+ .gloss-accordion-item--open {
212
+ .gloss-accordion-trigger__chevron {
213
+ transform: rotate(0deg);
214
+ }
215
+ }
216
+
217
+ // --- ANIMATION KEYFRAMES ---
218
+ @keyframes accordion-count-in {
219
+ from {
220
+ opacity: 0;
221
+ transform: scale(0.8);
222
+ }
223
+ to {
224
+ opacity: 1;
225
+ transform: scale(1);
226
+ }
227
+ }
228
+
229
+ // --- REDUCED MOTION ---
230
+ @media (prefers-reduced-motion: reduce) {
231
+ .gloss-accordion-trigger,
232
+ .gloss-accordion-trigger__chevron,
233
+ .gloss-accordion-content {
234
+ transition-duration: 0.01ms !important;
235
+ }
236
+ }