@leitware/composables 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,262 @@
1
+ import { defaultPreset, defaultPresetDark } from './default'
2
+
3
+ /**
4
+ * Oqita: friendly, tactile, and quietly colourful. Softness comes from shape,
5
+ * typography, and spacing; colour stays saturated, never washed out.
6
+ * Bricolage Grotesque headings + DM Sans body (optional font peers).
7
+ */
8
+ const shape: Record<string, string> = {
9
+ '--spacing': '0.25rem',
10
+ '--font-sans': '"DM Sans Variable", ui-sans-serif, system-ui, sans-serif',
11
+ '--font-heading': '"Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif',
12
+ '--font-brand': '"Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif',
13
+ '--font-size-base': '1rem',
14
+ '--leading-base': '1.5',
15
+ '--letter-spacing-base': '0.01em',
16
+ '--radius': '0.875rem',
17
+ '--border-width-base': '0.0625rem',
18
+ '--control-size-sm': 'calc(var(--spacing) * 10)',
19
+ '--control-size-md': 'calc(var(--spacing) * 11)',
20
+ '--control-size-lg': 'calc(var(--spacing) * 12)',
21
+ '--control-font-size': 'var(--text-base)',
22
+ '--button-height': 'var(--control-size-md)',
23
+ '--button-height-xs': 'calc(var(--spacing) * 8)',
24
+ '--button-height-sm': 'var(--control-size-sm)',
25
+ '--button-height-lg': 'var(--control-size-lg)',
26
+ '--button-font-size': 'var(--text-base)',
27
+ '--button-font-size-xs': 'var(--text-sm)',
28
+ '--button-font-size-sm': 'var(--text-sm)',
29
+ '--button-gap': 'calc(var(--spacing) * 2)',
30
+ '--button-radius': '9999px',
31
+ '--button-radius-xs': '9999px',
32
+ '--button-radius-sm': '9999px',
33
+ '--button-min-width-ratio': '2',
34
+ '--button-brand-font-weight': '600',
35
+ '--button-primary-shadow': '0 4px 0 #142B99, 0 8px 18px #2549E81F',
36
+ '--button-primary-hover-shadow': 'var(--button-primary-shadow)',
37
+ '--button-primary-border': 'transparent',
38
+ '--button-primary-hover-border': 'transparent',
39
+ '--button-secondary-border': 'transparent',
40
+ '--button-secondary-hover-bg': 'var(--bg-fill-secondary-hover)',
41
+ '--button-quiet-hover-bg': 'var(--bg-surface-hover)',
42
+ '--button-destructive-bg': '#B92C37',
43
+ '--button-destructive-text': '#FFFFFF',
44
+ '--button-destructive-border': 'transparent',
45
+ '--button-destructive-hover-border': 'transparent',
46
+ '--button-destructive-shadow': '0 4px 0 #7A1822, 0 8px 18px #B92C371F',
47
+ '--button-destructive-hover-shadow': 'var(--button-destructive-shadow)',
48
+ '--button-destructive-hover-background-image': 'linear-gradient(#9F202B, #9F202B)',
49
+ '--input-radius': 'var(--radius-lg)',
50
+ '--label-font-size': 'var(--text-sm)',
51
+ '--body-font-size': 'var(--text-base)',
52
+ '--body-line-height': 'var(--text-base--line-height)',
53
+ '--title-font-size': 'var(--text-lg)',
54
+ '--title-line-height': 'var(--text-lg--line-height)',
55
+ '--heading-font-size': 'var(--text-xl)',
56
+ '--heading-line-height': 'var(--text-xl--line-height)',
57
+ '--card-radius': 'calc(var(--radius) * 1.6)',
58
+ '--card-padding': 'calc(var(--spacing) * 5)',
59
+ '--card-border-width': 'calc(var(--border-width-base) * 0)',
60
+ '--alert-border-width': 'calc(var(--border-width-base) * 0)',
61
+ '--dialog-radius': 'calc(var(--radius) * 1.6)',
62
+ '--badge-radius': '9999px',
63
+ '--checkbox-radius': 'calc(var(--radius) * 0.4)',
64
+ '--choice-size': 'calc(var(--spacing) * 5)',
65
+ '--choice-border-color': 'var(--border-input)',
66
+ '--switch-height': 'calc(var(--spacing) * 6)',
67
+ '--slider-size': 'calc(var(--spacing) * 5)',
68
+ '--tabs-list-radius': '9999px',
69
+ '--tabs-tab-radius': '9999px',
70
+ '--tabs-list-padding': 'calc(var(--spacing) * 0.5)',
71
+ '--tabs-tab-height': 'var(--control-size-sm)',
72
+ '--shadow-offset-y': '3px',
73
+ '--shadow-blur': '8px',
74
+ '--shadow-spread': '-1px',
75
+ '--shadow-base-color': '#242D4512',
76
+ '--focus-ring-color': 'var(--border-focus)',
77
+ '--focus-ring-width': '3px',
78
+ '--focus-ring-offset': '3px',
79
+ '--focus-ring-opacity': '100%',
80
+ '--hover-ring-width': '0px',
81
+ '--hover-ring-color': 'transparent',
82
+ '--hover-shadow': 'none',
83
+ '--active-scale': '0.98',
84
+ }
85
+
86
+ // Neutral status surfaces keep larger areas calm. Saturated fills remain available
87
+ // for deliberate brand accents; labels retain their semantic colour.
88
+ function colourRoles(
89
+ surface: string,
90
+ roles: Record<string, { fill: string; text: string }>,
91
+ ): Record<string, string> {
92
+ return Object.fromEntries(
93
+ Object.entries(roles).flatMap(([role, { fill, text }]) => [
94
+ [`--bg-surface-${role}`, surface],
95
+ [`--bg-fill-${role}`, fill],
96
+ [`--text-${role}`, text],
97
+ [`--icon-${role}`, text],
98
+ [`--border-${role}`, surface],
99
+ ]),
100
+ )
101
+ }
102
+
103
+ const lightColours = colourRoles('#F0F1F3', {
104
+ brand: { fill: '#FF7518', text: '#572600' },
105
+ 'brand-2': { fill: '#FFCC00', text: '#514000' },
106
+ 'brand-3': { fill: '#18B86A', text: '#103D29' },
107
+ 'brand-4': { fill: '#00B7D4', text: '#103B50' },
108
+ 'brand-5': { fill: '#FF6090', text: '#581A32' },
109
+ info: { fill: '#137C99', text: '#103B50' },
110
+ success: { fill: '#167347', text: '#103D29' },
111
+ warning: { fill: '#946100', text: '#514000' },
112
+ critical: { fill: '#B92C37', text: '#641923' },
113
+ emphasis: { fill: '#2549E8', text: '#103B50' },
114
+ })
115
+
116
+ const darkColours = colourRoles('#27334A', {
117
+ brand: { fill: '#FF7518', text: '#FF9A40' },
118
+ 'brand-2': { fill: '#FFCC00', text: '#FFCC00' },
119
+ 'brand-3': { fill: '#18B86A', text: '#57D78B' },
120
+ 'brand-4': { fill: '#00B7D4', text: '#00B7D4' },
121
+ 'brand-5': { fill: '#FF6090', text: '#FF7BA8' },
122
+ info: { fill: '#00B7D4', text: '#00B7D4' },
123
+ success: { fill: '#57D78B', text: '#57D78B' },
124
+ warning: { fill: '#FFCC00', text: '#FFCC00' },
125
+ critical: { fill: '#FF8590', text: '#FF8590' },
126
+ emphasis: { fill: '#2549E8', text: '#00B7D4' },
127
+ })
128
+
129
+ const brandButtons = Object.fromEntries(
130
+ ['brand', 'brand-2', 'brand-3', 'brand-4', 'brand-5'].flatMap((role) => [
131
+ [`--button-${role}-bg`, `var(--bg-fill-${role})`],
132
+ [`--button-${role}-text`, 'var(--text-on-fill-brand)'],
133
+ [`--button-${role}-border`, 'transparent'],
134
+ [`--button-${role}-hover-border`, 'transparent'],
135
+ [`--button-${role}-hover-shadow`, 'none'],
136
+ ]),
137
+ )
138
+
139
+ export const oqita: Record<string, string> = {
140
+ ...defaultPreset,
141
+ ...shape,
142
+ ...brandButtons,
143
+ ...lightColours,
144
+ '--bg-default': '#FAF8F3',
145
+ '--bg-inverse': '#202B43',
146
+ '--bg-muted': '#EFEBE3',
147
+ '--bg-surface-default': '#FFFFFF',
148
+ '--bg-surface-popover': '#FFFFFF',
149
+ '--bg-surface-accent': '#EFEBE3',
150
+ '--bg-surface-field': '#FFFFFF',
151
+ '--bg-surface-input': '#FFFFFF',
152
+ '--bg-surface-hover': '#E7E2D8',
153
+ '--bg-surface-inverse': '#202B43',
154
+ '--bg-surface-transparent': '#202B430A',
155
+ '--bg-overlay': '#111A32A6',
156
+ '--bg-fill-default': '#FFFFFF',
157
+ '--bg-fill-primary': '#2549E8',
158
+ '--bg-fill-primary-hover': '#1C3BC4',
159
+ '--bg-fill-selected': '#2549E8',
160
+ '--bg-fill-secondary': '#EFEBE3',
161
+ '--bg-fill-secondary-hover': '#E3DED3',
162
+ '--bg-fill-secondary-inverse': '#FFFFFF',
163
+ '--bg-fill-transparent': '#202B430A',
164
+ '--text-default': '#202B43',
165
+ '--text-secondary': '#535B6C',
166
+ '--text-muted': '#616779',
167
+ '--text-disabled': '#9296A0',
168
+ '--text-inverse': '#FFFFFF',
169
+ '--text-on-fill-primary': '#FFFFFF',
170
+ '--text-on-fill-selected': '#FFFFFF',
171
+ '--text-on-fill-brand': '#202B43',
172
+ '--text-on-fill-secondary': '#202B43',
173
+ '--text-on-surface-accent': '#202B43',
174
+ '--text-link': '#2549C8',
175
+ '--icon-default': '#202B43',
176
+ '--icon-secondary': '#535B6C',
177
+ '--icon-disabled': '#9296A0',
178
+ '--icon-inverse': '#FFFFFF',
179
+ '--border-default': '#E2E4E8',
180
+ '--border-secondary': '#E2E4E8',
181
+ '--border-input': '#B3B9C3',
182
+ '--border-tertiary': '#CFD3DA',
183
+ '--border-disabled': '#DCD7CD',
184
+ '--border-inverse': '#535B6C',
185
+ '--border-focus': '#2549E8',
186
+ '--chart-1': '#2549E8',
187
+ '--chart-2': '#FF7518',
188
+ '--chart-3': '#167347',
189
+ '--chart-4': '#946100',
190
+ '--chart-5': '#B92F63',
191
+ '--sidebar-background': '#202B43',
192
+ '--sidebar-foreground': '#FFFFFF',
193
+ '--sidebar-primary': '#FFCC00',
194
+ '--sidebar-primary-foreground': '#202B43',
195
+ '--sidebar-accent': '#34425D',
196
+ '--sidebar-accent-foreground': '#FFFFFF',
197
+ '--sidebar-border': '#303B50',
198
+ '--sidebar-ring': '#FFCC00',
199
+ }
200
+
201
+ export const oqitaDark: Record<string, string> = {
202
+ ...defaultPresetDark,
203
+ ...shape,
204
+ ...brandButtons,
205
+ ...darkColours,
206
+ '--shadow-base-color': '#00000033',
207
+ '--bg-default': '#131C2E',
208
+ '--bg-inverse': '#FAF8F3',
209
+ '--bg-muted': '#27334A',
210
+ '--bg-surface-default': '#1D2940',
211
+ '--bg-surface-popover': '#1D2940',
212
+ '--bg-surface-accent': '#27334A',
213
+ '--bg-surface-field': '#131C2E',
214
+ '--bg-surface-input': '#131C2E',
215
+ '--bg-surface-hover': '#34425D',
216
+ '--bg-surface-inverse': '#FAF8F3',
217
+ '--bg-surface-transparent': '#FFFFFF0F',
218
+ '--bg-overlay': '#070D19C4',
219
+ '--bg-fill-default': '#1D2940',
220
+ '--bg-fill-primary': '#2549E8',
221
+ '--bg-fill-primary-hover': '#3155F0',
222
+ '--bg-fill-selected': '#2549E8',
223
+ '--bg-fill-secondary': '#34425D',
224
+ '--bg-fill-secondary-hover': '#42516F',
225
+ '--bg-fill-secondary-inverse': '#1D2940',
226
+ '--bg-fill-transparent': '#FFFFFF0F',
227
+ '--text-default': '#FAF8F3',
228
+ '--text-secondary': '#BAC3D2',
229
+ '--text-muted': '#A3AFC3',
230
+ '--text-disabled': '#6B7892',
231
+ '--text-inverse': '#202B43',
232
+ '--text-on-fill-primary': '#FFFFFF',
233
+ '--text-on-fill-selected': '#FFFFFF',
234
+ '--text-on-fill-brand': '#202B43',
235
+ '--text-on-fill-secondary': '#FAF8F3',
236
+ '--text-on-surface-accent': '#FAF8F3',
237
+ '--text-link': '#00B7D4',
238
+ '--icon-default': '#FAF8F3',
239
+ '--icon-secondary': '#BAC3D2',
240
+ '--icon-disabled': '#6B7892',
241
+ '--icon-inverse': '#202B43',
242
+ '--border-default': '#303B50',
243
+ '--border-secondary': '#303B50',
244
+ '--border-input': '#69758B',
245
+ '--border-tertiary': '#455167',
246
+ '--border-disabled': '#3D4B65',
247
+ '--border-inverse': '#CFCAC0',
248
+ '--border-focus': '#FFCC00',
249
+ '--chart-1': '#00B7D4',
250
+ '--chart-2': '#FF7518',
251
+ '--chart-3': '#57D78B',
252
+ '--chart-4': '#FFCC00',
253
+ '--chart-5': '#FF7BA8',
254
+ '--sidebar-background': '#10182A',
255
+ '--sidebar-foreground': '#FAF8F3',
256
+ '--sidebar-primary': '#FFCC00',
257
+ '--sidebar-primary-foreground': '#202B43',
258
+ '--sidebar-accent': '#27334A',
259
+ '--sidebar-accent-foreground': '#FAF8F3',
260
+ '--sidebar-border': '#27334A',
261
+ '--sidebar-ring': '#FFCC00',
262
+ }