@frontile/theme 0.17.1 → 0.18.0-alpha.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.
- package/README.md +139 -0
- package/declarations/colors/config.d.ts +64 -0
- package/declarations/colors/contrast.d.ts +16 -0
- package/declarations/colors/palette-absolute.d.ts +8 -0
- package/declarations/colors/palette-dark.d.ts +123 -0
- package/declarations/colors/palette-light.d.ts +123 -0
- package/declarations/colors/palette.d.ts +123 -0
- package/declarations/colors/semantic.d.ts +7 -1
- package/declarations/colors/types.d.ts +321 -15
- package/declarations/colors/util.d.ts +6 -1
- package/declarations/colors.d.ts +2 -2
- package/declarations/components/avatar.d.ts +42 -42
- package/declarations/components/button.d.ts +254 -152
- package/declarations/components/chip.d.ts +62 -103
- package/declarations/components/close-button.d.ts +42 -50
- package/declarations/components/divider.d.ts +43 -10
- package/declarations/components/dropdown.d.ts +42 -1
- package/declarations/components/forms/forms-legacy.d.ts +496 -178
- package/declarations/components/forms/forms.d.ts +891 -822
- package/declarations/components/listbox.d.ts +88 -79
- package/declarations/components/notification-card.d.ts +41 -84
- package/declarations/components/notifications-container.d.ts +42 -17
- package/declarations/components/overlays.d.ts +172 -84
- package/declarations/components/popover.d.ts +43 -16
- package/declarations/components/progress-bar.d.ts +44 -104
- package/declarations/components/spinner.d.ts +44 -30
- package/declarations/components/table.d.ts +51 -132
- package/declarations/plugin/default-config.d.ts +63 -9
- package/declarations/plugin/overlays.d.ts +2 -6
- package/declarations/plugin/power-select.d.ts +1 -1
- package/declarations/plugin/resolve.d.ts +1 -2
- package/declarations/tw.d.ts +40 -1
- package/declarations/types.d.ts +29 -12
- package/dist/colors.js +1 -1
- package/dist/config-4CswsBlg.js +342 -0
- package/dist/config-4CswsBlg.js.map +1 -0
- package/dist/config-B3XkEtHW.js +377 -0
- package/dist/config-B3XkEtHW.js.map +1 -0
- package/dist/config-BpWBpuzR.js +335 -0
- package/dist/config-BpWBpuzR.js.map +1 -0
- package/dist/config-Cle59Y4k.js +523 -0
- package/dist/config-Cle59Y4k.js.map +1 -0
- package/dist/config-D0EoeVzn.js +388 -0
- package/dist/config-D0EoeVzn.js.map +1 -0
- package/dist/config-DBAavoE2.js +336 -0
- package/dist/config-DBAavoE2.js.map +1 -0
- package/dist/config-Oysuq2Z9.js +341 -0
- package/dist/config-Oysuq2Z9.js.map +1 -0
- package/dist/config-PYki2g7N.js +335 -0
- package/dist/config-PYki2g7N.js.map +1 -0
- package/dist/forms-legacy-15iy0KmK.js +1851 -0
- package/dist/forms-legacy-15iy0KmK.js.map +1 -0
- package/dist/forms-legacy-B-L2HELt.js +1881 -0
- package/dist/forms-legacy-B-L2HELt.js.map +1 -0
- package/dist/forms-legacy-BMIAioRi.js +1807 -0
- package/dist/forms-legacy-BMIAioRi.js.map +1 -0
- package/dist/forms-legacy-B_EygtyK.js +1763 -0
- package/dist/forms-legacy-B_EygtyK.js.map +1 -0
- package/dist/forms-legacy-CVLZ-9BG.js +1804 -0
- package/dist/forms-legacy-CVLZ-9BG.js.map +1 -0
- package/dist/forms-legacy-CuFc3hcn.js +1807 -0
- package/dist/forms-legacy-CuFc3hcn.js.map +1 -0
- package/dist/forms-legacy-DiKImAli.js +1809 -0
- package/dist/forms-legacy-DiKImAli.js.map +1 -0
- package/dist/forms-legacy-edWQVbZP.js +1809 -0
- package/dist/forms-legacy-edWQVbZP.js.map +1 -0
- package/dist/index.css +63 -0
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/plugin.js +184 -128
- package/dist/plugin.js.map +1 -1
- package/dist/styles/font-faces.css +26 -0
- package/dist/styles/theme.css +48 -0
- package/dist/styles/typography.css +291 -0
- package/package.json +28 -23
- package/public/fonts/stix-two-text-italic-variable.woff2 +0 -0
- package/public/fonts/stix-two-text-variable.woff2 +0 -0
- package/src/index.css +63 -0
- package/src/styles/font-faces.css +26 -0
- package/src/styles/theme.css +48 -0
- package/src/styles/typography.css +291 -0
package/dist/plugin.js
CHANGED
|
@@ -1,40 +1,114 @@
|
|
|
1
1
|
import plugin from 'tailwindcss/plugin';
|
|
2
|
-
import { B as notificationTransitions, E as overlayTransitions } from './forms-legacy-
|
|
2
|
+
import { B as notificationTransitions, E as overlayTransitions } from './forms-legacy-B-L2HELt.js';
|
|
3
3
|
import svgToDataUri from 'mini-svg-data-uri';
|
|
4
4
|
import { flatten } from 'flat';
|
|
5
5
|
import kebabCase from 'lodash.kebabcase';
|
|
6
6
|
import mapKeys from 'lodash.mapkeys';
|
|
7
|
-
import
|
|
7
|
+
import { parse, wcagContrast, oklch } from 'culori';
|
|
8
8
|
import deepMerge from 'deepmerge';
|
|
9
|
-
import { s as semanticColors } from './
|
|
10
|
-
export { c as swapColorValues } from './semantic-DUv6Lpqq.js';
|
|
9
|
+
import { s as semanticColors, c as black, w as white } from './config-Cle59Y4k.js';
|
|
11
10
|
import powerSelectPlugin from 'tailwindcss-ember-power-select';
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
12
|
+
// No default layout values - defaults are in index.css
|
|
13
|
+
// Users can override via CSS or configure via JS
|
|
14
|
+
const baseLayout = {};
|
|
16
15
|
const defaultConfig = {
|
|
17
|
-
prefix: 'frontile',
|
|
18
16
|
themes: {
|
|
19
17
|
light: {
|
|
20
18
|
colors: semanticColors.light,
|
|
21
|
-
layout:
|
|
22
|
-
...baseLayout,
|
|
23
|
-
hoverOpacity: '.8'
|
|
24
|
-
}
|
|
19
|
+
layout: baseLayout
|
|
25
20
|
},
|
|
26
21
|
dark: {
|
|
27
22
|
colors: semanticColors.dark,
|
|
28
|
-
layout:
|
|
29
|
-
...baseLayout,
|
|
30
|
-
hoverOpacity: '.7'
|
|
31
|
-
}
|
|
23
|
+
layout: baseLayout
|
|
32
24
|
}
|
|
33
25
|
}
|
|
34
26
|
};
|
|
35
27
|
|
|
28
|
+
function swapColorValues(colors) {
|
|
29
|
+
const swappedColors = {};
|
|
30
|
+
const keys = Object.keys(colors);
|
|
31
|
+
const length = keys.length;
|
|
32
|
+
for (let i = 0; i < length / 2; i++) {
|
|
33
|
+
const key1 = keys[i];
|
|
34
|
+
const key2 = keys[length - 1 - i];
|
|
35
|
+
swappedColors[key1] = colors[key2];
|
|
36
|
+
swappedColors[key2] = colors[key1];
|
|
37
|
+
}
|
|
38
|
+
if (length % 2 !== 0) {
|
|
39
|
+
const middleKey = keys[Math.floor(length / 2)];
|
|
40
|
+
swappedColors[middleKey] = colors[middleKey];
|
|
41
|
+
}
|
|
42
|
+
return swappedColors;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Pre-parse absolute colors once (these are known-valid hex colors)
|
|
46
|
+
const parsedBlack = parse(black);
|
|
47
|
+
const parsedWhite = parse(white);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get optimal contrasting color (black or white) for text on a given background.
|
|
51
|
+
* Uses WCAG contrast ratios to determine which provides better readability.
|
|
52
|
+
*/
|
|
53
|
+
function getContrastingColor(backgroundColor) {
|
|
54
|
+
const bgColor = parse(backgroundColor);
|
|
55
|
+
if (!bgColor || !parsedBlack || !parsedWhite) {
|
|
56
|
+
console.warn(`Failed to parse color: ${backgroundColor}, defaulting to white`);
|
|
57
|
+
return white;
|
|
58
|
+
}
|
|
59
|
+
const contrastWithBlack = wcagContrast(bgColor, parsedBlack);
|
|
60
|
+
const contrastWithWhite = wcagContrast(bgColor, parsedWhite);
|
|
61
|
+
return contrastWithBlack > contrastWithWhite ? black : white;
|
|
62
|
+
}
|
|
63
|
+
|
|
36
64
|
const parsedColorsCache = {};
|
|
37
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Parse a color value and convert it to OKLCH format.
|
|
67
|
+
*/
|
|
68
|
+
function parseAndFormatColor(colorValue) {
|
|
69
|
+
const parsed = parse(colorValue);
|
|
70
|
+
if (!parsed) {
|
|
71
|
+
throw new Error(`Failed to parse color: ${colorValue}`);
|
|
72
|
+
}
|
|
73
|
+
const color = oklch(parsed);
|
|
74
|
+
const l = ((color.l ?? 0) * 100).toFixed(2);
|
|
75
|
+
const c = (color.c ?? 0).toFixed(4);
|
|
76
|
+
const h = (color.h ?? 0).toFixed(2);
|
|
77
|
+
const alpha = color.alpha ?? 1;
|
|
78
|
+
const formatted = alpha < 1 ? `oklch(${l}% ${c} ${h} / ${alpha})` : `oklch(${l}% ${c} ${h})`;
|
|
79
|
+
return {
|
|
80
|
+
formatted,
|
|
81
|
+
alpha
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get parsed color from cache or parse and cache it.
|
|
87
|
+
*/
|
|
88
|
+
function getCachedColor(colorValue) {
|
|
89
|
+
if (!parsedColorsCache[colorValue]) {
|
|
90
|
+
parsedColorsCache[colorValue] = parseAndFormatColor(colorValue);
|
|
91
|
+
}
|
|
92
|
+
return parsedColorsCache[colorValue];
|
|
93
|
+
}
|
|
94
|
+
const SEMANTIC_COLOR_PREFIXES = ['neutral', 'brand', 'accent', 'success', 'danger', 'warning', 'surface-solid'];
|
|
95
|
+
const EXCLUDED_COLORS = ['background', 'focus', 'divider'];
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Determine if a color should have an "on-" variant generated.
|
|
99
|
+
* Includes semantic colors and surface-solid-*.
|
|
100
|
+
* Excludes utility colors and transparent overlays.
|
|
101
|
+
*/
|
|
102
|
+
function shouldGenerateOnColor(colorName) {
|
|
103
|
+
if (EXCLUDED_COLORS.includes(colorName)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (colorName.startsWith('surface-overlay')) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return SEMANTIC_COLOR_PREFIXES.some(prefix => colorName.startsWith(prefix));
|
|
110
|
+
}
|
|
111
|
+
function resolveThemes(themes = {}, defaultTheme) {
|
|
38
112
|
const resolved = {
|
|
39
113
|
variants: [],
|
|
40
114
|
utilities: {},
|
|
@@ -46,15 +120,22 @@ function resolveThemes(themes = {}, defaultTheme, prefix) {
|
|
|
46
120
|
layout,
|
|
47
121
|
colors
|
|
48
122
|
}] of Object.entries(themes)) {
|
|
49
|
-
|
|
123
|
+
let cssSelector = `.${themeName}`;
|
|
50
124
|
let baseSelector = '';
|
|
51
125
|
const scheme = themeName === 'light' || themeName === 'dark' ? themeName : extend;
|
|
52
126
|
|
|
127
|
+
// Add theme-inverse selectors
|
|
128
|
+
if (themeName === 'light') {
|
|
129
|
+
cssSelector = `${cssSelector}, .dark .theme-inverse`;
|
|
130
|
+
} else if (themeName === 'dark') {
|
|
131
|
+
cssSelector = `${cssSelector}, .light .theme-inverse`;
|
|
132
|
+
}
|
|
133
|
+
|
|
53
134
|
// if the theme is the default theme, add the selector to the root element
|
|
54
135
|
if (themeName === defaultTheme) {
|
|
55
136
|
baseSelector = `:root, ${cssSelector}`;
|
|
56
137
|
}
|
|
57
|
-
|
|
138
|
+
const themeRules = scheme ? {
|
|
58
139
|
'color-scheme': scheme
|
|
59
140
|
} : {};
|
|
60
141
|
const flatColors = flattenThemeObject(colors);
|
|
@@ -64,50 +145,71 @@ function resolveThemes(themes = {}, defaultTheme, prefix) {
|
|
|
64
145
|
definition: [`&.${themeName}`]
|
|
65
146
|
});
|
|
66
147
|
|
|
67
|
-
|
|
68
|
-
* Colors
|
|
69
|
-
*/
|
|
148
|
+
// Process colors and generate CSS variables
|
|
70
149
|
for (const [colorName, colorValue] of Object.entries(flatColors)) {
|
|
71
150
|
if (!colorValue) continue;
|
|
151
|
+
const cssVar = `--color-${colorName}`;
|
|
152
|
+
|
|
153
|
+
// Handle CSS variable references (e.g., var(--color-name))
|
|
154
|
+
if (colorValue.startsWith('var(')) {
|
|
155
|
+
themeRules[cssVar] = colorValue;
|
|
156
|
+
resolved.colors[colorName] = `var(${cssVar})`;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
72
159
|
try {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
160
|
+
const {
|
|
161
|
+
formatted
|
|
162
|
+
} = getCachedColor(colorValue);
|
|
163
|
+
themeRules[cssVar] = formatted;
|
|
164
|
+
resolved.colors[colorName] = `var(${cssVar})`;
|
|
165
|
+
} catch (error) {
|
|
166
|
+
// eslint-disable-next-line no-console
|
|
167
|
+
console.warn(`Failed to parse color "${colorName}":`, error);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Generate "on-" colors for optimal contrast on semantic backgrounds
|
|
172
|
+
for (const [colorName, colorValue] of Object.entries(flatColors)) {
|
|
173
|
+
if (!shouldGenerateOnColor(colorName)) continue;
|
|
81
174
|
|
|
82
|
-
|
|
83
|
-
|
|
175
|
+
// Check if user has already defined this on-color
|
|
176
|
+
const onColorName = `on-${colorName}`;
|
|
177
|
+
if (flatColors[onColorName]) {
|
|
178
|
+
// User provided custom on-color, skip auto-generation
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Skip CSS variable references - can't calculate contrast for them
|
|
183
|
+
if (colorValue.startsWith('var(')) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
const contrastColor = getContrastingColor(colorValue);
|
|
188
|
+
const {
|
|
189
|
+
formatted
|
|
190
|
+
} = getCachedColor(contrastColor);
|
|
191
|
+
const cssVar = `--color-${onColorName}`;
|
|
192
|
+
themeRules[cssVar] = formatted;
|
|
193
|
+
resolved.colors[onColorName] = `var(${cssVar})`;
|
|
84
194
|
} catch (error) {
|
|
85
195
|
// eslint-disable-next-line no-console
|
|
86
|
-
console.
|
|
196
|
+
console.warn(`Failed to generate on-color for "${colorName}":`, error);
|
|
87
197
|
}
|
|
88
198
|
}
|
|
89
199
|
|
|
90
|
-
|
|
91
|
-
* Layout
|
|
92
|
-
*/
|
|
200
|
+
// Process layout variables
|
|
93
201
|
for (const [key, value] of Object.entries(flatLayout)) {
|
|
94
202
|
if (!value) continue;
|
|
95
|
-
const
|
|
203
|
+
const varPrefix = `--${key}`;
|
|
96
204
|
if (typeof value === 'object') {
|
|
97
205
|
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
98
|
-
const
|
|
99
|
-
themeRules =
|
|
100
|
-
...themeRules,
|
|
101
|
-
[nestedLayoutVariable]: nestedValue
|
|
102
|
-
};
|
|
206
|
+
const cssVar = nestedKey === 'DEFAULT' ? varPrefix : `${varPrefix}-${nestedKey}`;
|
|
207
|
+
themeRules[cssVar] = nestedValue;
|
|
103
208
|
}
|
|
104
209
|
} else {
|
|
105
|
-
//
|
|
106
|
-
const formattedValue =
|
|
107
|
-
themeRules =
|
|
108
|
-
...themeRules,
|
|
109
|
-
[layoutVariablePrefix]: formattedValue
|
|
110
|
-
};
|
|
210
|
+
// Format opacity values (e.g., 0.5 -> .5)
|
|
211
|
+
const formattedValue = varPrefix.includes('opacity') && typeof value === 'number' ? String(value).replace(/^0\./, '.') : value;
|
|
212
|
+
themeRules[varPrefix] = formattedValue;
|
|
111
213
|
}
|
|
112
214
|
}
|
|
113
215
|
if (baseSelector) {
|
|
@@ -146,8 +248,7 @@ function resolveConfig(userConfig = {}) {
|
|
|
146
248
|
const {
|
|
147
249
|
themes: userThemes = {},
|
|
148
250
|
defaultTheme = 'light',
|
|
149
|
-
layout: userLayout
|
|
150
|
-
prefix = defaultConfig.prefix
|
|
251
|
+
layout: userLayout
|
|
151
252
|
} = userConfig;
|
|
152
253
|
const themes = defaultConfig.themes;
|
|
153
254
|
if (typeof userLayout === 'object') {
|
|
@@ -172,21 +273,21 @@ function resolveConfig(userConfig = {}) {
|
|
|
172
273
|
});
|
|
173
274
|
return {
|
|
174
275
|
themes,
|
|
175
|
-
defaultTheme
|
|
176
|
-
prefix
|
|
276
|
+
defaultTheme
|
|
177
277
|
};
|
|
178
278
|
}
|
|
179
279
|
|
|
180
|
-
function drawerSizes(addComponents,
|
|
181
|
-
|
|
182
|
-
|
|
280
|
+
function drawerSizes(addComponents, margin) {
|
|
281
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'full'];
|
|
282
|
+
sizes.forEach(key => {
|
|
283
|
+
const sizeVar = `var(--drawer-${key})`;
|
|
183
284
|
let rules = {
|
|
184
|
-
maxHeight:
|
|
285
|
+
maxHeight: sizeVar
|
|
185
286
|
};
|
|
186
287
|
if (key !== 'full') {
|
|
187
288
|
rules = {
|
|
188
289
|
...rules,
|
|
189
|
-
[`@media(max-height: calc(${
|
|
290
|
+
[`@media(max-height: calc(${sizeVar} + ${margin}))`]: {
|
|
190
291
|
maxHeight: `calc(100vh - ${margin})`
|
|
191
292
|
}
|
|
192
293
|
};
|
|
@@ -195,12 +296,12 @@ function drawerSizes(addComponents, sizes, margin) {
|
|
|
195
296
|
[`.drawer--vertical-${key}`]: rules
|
|
196
297
|
});
|
|
197
298
|
rules = {
|
|
198
|
-
maxWidth:
|
|
299
|
+
maxWidth: sizeVar
|
|
199
300
|
};
|
|
200
301
|
if (key !== 'full') {
|
|
201
302
|
rules = {
|
|
202
303
|
...rules,
|
|
203
|
-
[`@media(max-width: calc(${
|
|
304
|
+
[`@media(max-width: calc(${sizeVar} + ${margin}))`]: {
|
|
204
305
|
maxWidth: `calc(100vw - ${margin})`
|
|
205
306
|
}
|
|
206
307
|
};
|
|
@@ -210,22 +311,23 @@ function drawerSizes(addComponents, sizes, margin) {
|
|
|
210
311
|
});
|
|
211
312
|
});
|
|
212
313
|
}
|
|
213
|
-
function modalSizes(addComponents,
|
|
214
|
-
|
|
215
|
-
|
|
314
|
+
function modalSizes(addComponents, margin) {
|
|
315
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'full'];
|
|
316
|
+
sizes.forEach(key => {
|
|
317
|
+
const sizeVar = `var(--modal-${key})`;
|
|
216
318
|
let rules = {};
|
|
217
319
|
if (key === 'full') {
|
|
218
320
|
rules = {
|
|
219
|
-
width:
|
|
220
|
-
height:
|
|
321
|
+
width: sizeVar,
|
|
322
|
+
height: sizeVar,
|
|
221
323
|
marginTop: 'auto',
|
|
222
324
|
marginBottom: 'auto',
|
|
223
325
|
borderRadius: '0'
|
|
224
326
|
};
|
|
225
327
|
} else {
|
|
226
328
|
rules = {
|
|
227
|
-
maxWidth:
|
|
228
|
-
[`@media(max-width: ${
|
|
329
|
+
maxWidth: sizeVar,
|
|
330
|
+
[`@media(max-width: ${sizeVar})`]: {
|
|
229
331
|
maxWidth: `calc(100vw - ${margin})`
|
|
230
332
|
}
|
|
231
333
|
};
|
|
@@ -236,7 +338,7 @@ function modalSizes(addComponents, sizes, margin) {
|
|
|
236
338
|
});
|
|
237
339
|
}
|
|
238
340
|
|
|
239
|
-
function registerPowerSelectComponents(addComponents
|
|
341
|
+
function registerPowerSelectComponents(addComponents) {
|
|
240
342
|
addComponents({
|
|
241
343
|
'.ember-power-select-trigger, .ember-power-select-dropdown, .ember-power-select-search-input': {
|
|
242
344
|
'--tw-bg-opacity': '1',
|
|
@@ -245,24 +347,24 @@ function registerPowerSelectComponents(addComponents, prefix) {
|
|
|
245
347
|
'--tw-placeholder-opacity': '1'
|
|
246
348
|
},
|
|
247
349
|
'.dark .ember-power-select-search-input, .dark .ember-power-select-trigger': {
|
|
248
|
-
backgroundColor: `hsl(var(
|
|
350
|
+
backgroundColor: `hsl(var(--default-100) / var(--default-100-opacity, var(--tw-bg-opacity)))`
|
|
249
351
|
},
|
|
250
352
|
'.dark .ember-power-select-dropdown': {
|
|
251
|
-
backgroundColor: `hsl(var(
|
|
353
|
+
backgroundColor: `hsl(var(--default-200) / var(--default-200-opacity, var(--tw-bg-opacity)))`
|
|
252
354
|
}
|
|
253
355
|
});
|
|
254
356
|
powerSelectPlugin.registerComponents({
|
|
255
357
|
addComponents
|
|
256
358
|
}, {}, {
|
|
257
|
-
textColor: `hsl(var(
|
|
258
|
-
disabledTextColor: `hsl(var(
|
|
259
|
-
disabledBorderColor: `hsl(var(
|
|
260
|
-
placeholderTextColor: `hsl(var(
|
|
359
|
+
textColor: `hsl(var(--default-900) / var(--default-900-opacity, var(--tw-bg-opacity)))`,
|
|
360
|
+
disabledTextColor: `hsl(var(--default-500) / var(--default-500-opacity, var(--tw-text-opacity)))`,
|
|
361
|
+
disabledBorderColor: `hsl(var(--default-200) / var(--default-200-opacity, var(--tw-border-opacity)))`,
|
|
362
|
+
placeholderTextColor: `hsl(var(--default-400) / var(--default-400-opacity, var(--tw-placeholder-opacity)))`,
|
|
261
363
|
backgroundColor: 'white',
|
|
262
364
|
dropdownBackgroundColor: 'white',
|
|
263
|
-
borderColor: `hsl(var(
|
|
264
|
-
focusBorderColor: `hsl(var(
|
|
265
|
-
invalidBorderColor: `hsl(var(
|
|
365
|
+
borderColor: `hsl(var(--default-400) / var(--default-400-opacity, var(--tw-border-opacity)))`,
|
|
366
|
+
focusBorderColor: `hsl(var(--primary-400) / var(--primary-400-opacity, var(--tw-border-opacity)))`,
|
|
367
|
+
invalidBorderColor: `hsl(var(--danger-400) / var(--danger-400-opacity, var(--tw-border-opacity)))`
|
|
266
368
|
// triggerFocusBoxShadow: config.focusBoxShadow,
|
|
267
369
|
// triggerFocusBoxShadowInvalid: config.focusBoxShadowInvalid,
|
|
268
370
|
// searchInputFocusBoxShadow: config.focusBoxShadow
|
|
@@ -310,7 +412,7 @@ const safelist = ['js-focus-visible', 'sr-only', 'notification-transition--slide
|
|
|
310
412
|
|
|
311
413
|
function frontile(config = {}) {
|
|
312
414
|
const c = resolveConfig(config);
|
|
313
|
-
const resolved = resolveThemes(c.themes, c.defaultTheme
|
|
415
|
+
const resolved = resolveThemes(c.themes, c.defaultTheme);
|
|
314
416
|
return plugin(({
|
|
315
417
|
addComponents,
|
|
316
418
|
theme,
|
|
@@ -327,28 +429,12 @@ function frontile(config = {}) {
|
|
|
327
429
|
resolved?.variants.forEach(variant => {
|
|
328
430
|
addVariant(variant.name, variant.definition);
|
|
329
431
|
});
|
|
330
|
-
addVariant('data-is-active', '&[data-active=true]');
|
|
331
|
-
addVariant('group-data-is-active', ':merge(.group)[data-active="true"] &');
|
|
332
432
|
addTransitions(addComponents, '.notification-transition', notificationTransitions);
|
|
333
433
|
addTransitions(addComponents, '.overlay-transition', overlayTransitions);
|
|
334
434
|
|
|
335
|
-
// drawer sizes
|
|
336
|
-
drawerSizes(addComponents,
|
|
337
|
-
|
|
338
|
-
sm: '24rem',
|
|
339
|
-
md: '28rem',
|
|
340
|
-
lg: '32rem',
|
|
341
|
-
xl: '36rem',
|
|
342
|
-
full: '100%'
|
|
343
|
-
}, theme('spacing.8'));
|
|
344
|
-
modalSizes(addComponents, {
|
|
345
|
-
xs: '20rem',
|
|
346
|
-
sm: '24rem',
|
|
347
|
-
md: '28rem',
|
|
348
|
-
lg: '32rem',
|
|
349
|
-
xl: '36rem',
|
|
350
|
-
full: '100%'
|
|
351
|
-
}, theme('spacing.8'));
|
|
435
|
+
// drawer and modal sizes (using CSS variables)
|
|
436
|
+
drawerSizes(addComponents, theme('spacing.8'));
|
|
437
|
+
modalSizes(addComponents, theme('spacing.8'));
|
|
352
438
|
addComponents({
|
|
353
439
|
'.checked-bg-checkbox:checked': {
|
|
354
440
|
backgroundImage: `url("${svgToDataUri(checkboxIcon)}")`
|
|
@@ -360,42 +446,12 @@ function frontile(config = {}) {
|
|
|
360
446
|
backgroundImage: `url("${svgToDataUri(radioIcon)}")`
|
|
361
447
|
}
|
|
362
448
|
});
|
|
363
|
-
registerPowerSelectComponents(addComponents
|
|
449
|
+
registerPowerSelectComponents(addComponents);
|
|
364
450
|
}, {
|
|
365
451
|
theme: {
|
|
366
452
|
extend: {
|
|
367
453
|
colors: {
|
|
368
454
|
...resolved?.colors
|
|
369
|
-
},
|
|
370
|
-
opacity: {
|
|
371
|
-
hover: `var(--${c.prefix}-hover-opacity)`,
|
|
372
|
-
disabled: `var(--${c.prefix}-disabled-opacity)`
|
|
373
|
-
},
|
|
374
|
-
aria: {
|
|
375
|
-
invalid: 'invalid="true"'
|
|
376
|
-
},
|
|
377
|
-
animation: {
|
|
378
|
-
loading: 'loading 1.5s linear infinite',
|
|
379
|
-
swing: 'swing 2s ease-in-out infinite'
|
|
380
|
-
},
|
|
381
|
-
keyframes: {
|
|
382
|
-
loading: {
|
|
383
|
-
from: {
|
|
384
|
-
transform: 'translateX(-100%) scaleX(0)'
|
|
385
|
-
},
|
|
386
|
-
to: {
|
|
387
|
-
transform: 'translateX(200%) scaleX(3)'
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
swing: {
|
|
391
|
-
'0%, 100%': {
|
|
392
|
-
width: '50%',
|
|
393
|
-
transform: 'translateX(-25%)'
|
|
394
|
-
},
|
|
395
|
-
'50%': {
|
|
396
|
-
transform: 'translateX(125%)'
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
455
|
}
|
|
400
456
|
}
|
|
401
457
|
}
|
|
@@ -405,5 +461,5 @@ const checkboxIcon = `<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3
|
|
|
405
461
|
const checkboxIndeterminateIcon = `<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M3 7.5C3 7.22386 3.22386 7 3.5 7H12.5C12.7761 7 13 7.22386 13 7.5V8.5C13 8.77614 12.7761 9 12.5 9H3.5C3.22386 9 3 8.77614 3 8.5V7.5Z" fill="white"/></svg>`;
|
|
406
462
|
const radioIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6" stroke="white" stroke-width="3" fill="none" /></svg>`;
|
|
407
463
|
|
|
408
|
-
export { frontile, safelist };
|
|
464
|
+
export { frontile, safelist, swapColorValues };
|
|
409
465
|
//# sourceMappingURL=plugin.js.map
|