@udixio/ui-react 2.10.10 → 2.10.12
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/CHANGELOG.md +31 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +2740 -2655
- package/dist/lib/components/Carousel.d.ts.map +1 -1
- package/dist/lib/components/CarouselItem.d.ts.map +1 -1
- package/dist/lib/components/ProgressIndicator.d.ts.map +1 -1
- package/dist/lib/effects/ThemeProvider.d.ts.map +1 -1
- package/dist/lib/effects/theme.worker.d.ts +13 -0
- package/dist/lib/effects/theme.worker.d.ts.map +1 -0
- package/dist/lib/interfaces/progress-indicator.interface.d.ts +7 -1
- package/dist/lib/interfaces/progress-indicator.interface.d.ts.map +1 -1
- package/dist/lib/styles/carousel-item.style.d.ts.map +1 -1
- package/dist/lib/styles/progress-indicator.style.d.ts +2 -2
- package/dist/lib/styles/progress-indicator.style.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/components/Card.tsx +1 -1
- package/src/lib/components/Carousel.tsx +148 -259
- package/src/lib/components/CarouselItem.tsx +3 -10
- package/src/lib/components/ProgressIndicator.tsx +80 -26
- package/src/lib/effects/ThemeProvider.tsx +70 -26
- package/src/lib/effects/theme.worker.ts +97 -0
- package/src/lib/interfaces/progress-indicator.interface.ts +7 -1
- package/src/lib/styles/card.style.ts +2 -2
- package/src/lib/styles/carousel-item.style.ts +1 -5
- package/src/lib/styles/progress-indicator.style.ts +24 -8
- package/vite.config.ts +0 -4
|
@@ -43,13 +43,9 @@ export const ProgressIndicator = ({
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
useEffect(() => {
|
|
46
|
-
if (
|
|
47
|
-
(variant === 'circular-indeterminate' ||
|
|
48
|
-
variant === 'linear-indeterminate') &&
|
|
49
|
-
completedPercentage !== 100
|
|
50
|
-
) {
|
|
46
|
+
if (variant === 'circular-indeterminate' && completedPercentage !== 100) {
|
|
51
47
|
const interval = setInterval(() => {
|
|
52
|
-
setCompletedPercentage(togglePercentage ?
|
|
48
|
+
setCompletedPercentage(togglePercentage ? 20 : 40);
|
|
53
49
|
setTogglePercentage(!togglePercentage);
|
|
54
50
|
}, getTransitionRotate() * 1000);
|
|
55
51
|
return () => clearInterval(interval);
|
|
@@ -83,26 +79,62 @@ export const ProgressIndicator = ({
|
|
|
83
79
|
|
|
84
80
|
return (
|
|
85
81
|
<>
|
|
86
|
-
{
|
|
87
|
-
|
|
82
|
+
{variant === 'linear-indeterminate' && (
|
|
83
|
+
<div className={styles.progressIndicator} {...restProps}>
|
|
84
|
+
<motion.div
|
|
85
|
+
animate={{
|
|
86
|
+
width: ['0%', '0%', '0%', '20%'],
|
|
87
|
+
marginLeft: ['0px', '0px', '6px', '6px'],
|
|
88
|
+
marginRight: ['0px', '0px', '6px', '6px'],
|
|
89
|
+
}}
|
|
90
|
+
transition={{
|
|
91
|
+
duration: 1.5,
|
|
92
|
+
repeat: Infinity,
|
|
93
|
+
ease: 'easeInOut',
|
|
94
|
+
times: [0, 0.499, 0.5, 1],
|
|
95
|
+
}}
|
|
96
|
+
style={{ flexShrink: 0 }}
|
|
97
|
+
className={styles.activeIndicator}
|
|
98
|
+
/>
|
|
99
|
+
<motion.div
|
|
100
|
+
animate={{ width: ['0%', '40%', '100%'] }}
|
|
101
|
+
transition={{ duration: 1.5, repeat: Infinity, ease: 'easeInOut' }}
|
|
102
|
+
style={{ flexShrink: 0 }}
|
|
103
|
+
className={styles.firstTrack}
|
|
104
|
+
/>
|
|
105
|
+
<motion.div
|
|
106
|
+
animate={{ width: ['20%', '60%', '20%'] }}
|
|
107
|
+
transition={{
|
|
108
|
+
duration: 1.5,
|
|
109
|
+
repeat: Infinity,
|
|
110
|
+
ease: 'easeInOut',
|
|
111
|
+
times: [0, 0.5, 1],
|
|
112
|
+
}}
|
|
113
|
+
style={{ flexShrink: 0, marginLeft: '6px' }}
|
|
114
|
+
className={styles.activeIndicator}
|
|
115
|
+
/>
|
|
116
|
+
<div style={{ marginLeft: '6px' }} className={styles.lastTrack} />
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
{variant === 'linear-determinate' && (
|
|
88
120
|
<div className={styles.progressIndicator} {...restProps}>
|
|
89
121
|
<div
|
|
90
122
|
style={{
|
|
91
123
|
width: `${completedPercentage}%`,
|
|
92
124
|
transition: `width ${transitionDuration}ms ease-in-out ${completedPercentage == 100 ? ', max-height 200ms 0.5s ease-in-out' : ''}`,
|
|
93
125
|
}}
|
|
94
|
-
className={styles.
|
|
126
|
+
className={styles.activeIndicator}
|
|
95
127
|
></div>
|
|
96
128
|
<div
|
|
97
129
|
style={{
|
|
98
130
|
marginLeft: completedPercentage != 100 ? '6px' : '0px',
|
|
99
131
|
transition: `width ${transitionDuration}ms ease-in-out ${completedPercentage == 100 ? `, max-height 200ms 0.5s ease-in-out, margin-left ${transitionDuration}ms ${transitionDuration / 1.5}ms` : ''}`,
|
|
100
132
|
}}
|
|
101
|
-
className={styles.
|
|
133
|
+
className={styles.lastTrack}
|
|
102
134
|
></div>
|
|
103
135
|
<div
|
|
104
136
|
style={{
|
|
105
|
-
width: `
|
|
137
|
+
width: `4px`,
|
|
106
138
|
transition: `width ${transitionDuration}ms ease-in-out, max-height 200ms 0.5s ease-in-out`,
|
|
107
139
|
}}
|
|
108
140
|
className={styles.stop}
|
|
@@ -112,17 +144,25 @@ export const ProgressIndicator = ({
|
|
|
112
144
|
{(variant === 'circular-determinate' ||
|
|
113
145
|
variant == 'circular-indeterminate') && (
|
|
114
146
|
<motion.svg
|
|
115
|
-
key={
|
|
147
|
+
key={
|
|
148
|
+
variant === 'circular-indeterminate'
|
|
149
|
+
? togglePercentage + ''
|
|
150
|
+
: 'static'
|
|
151
|
+
}
|
|
116
152
|
width="48"
|
|
117
153
|
height="48"
|
|
118
154
|
viewBox="0 0 48 48"
|
|
119
155
|
initial={{ rotate: -90 }}
|
|
120
|
-
animate={{ rotate: 270 }}
|
|
121
|
-
transition={
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
156
|
+
animate={{ rotate: variant === 'circular-indeterminate' ? 270 : -90 }}
|
|
157
|
+
transition={
|
|
158
|
+
variant === 'circular-indeterminate'
|
|
159
|
+
? {
|
|
160
|
+
repeat: Infinity,
|
|
161
|
+
duration: getTransitionRotate(),
|
|
162
|
+
ease: 'linear',
|
|
163
|
+
}
|
|
164
|
+
: { duration: transitionDuration / 1000 }
|
|
165
|
+
}
|
|
126
166
|
className={styles.progressIndicator}
|
|
127
167
|
{...(restProps as any)}
|
|
128
168
|
>
|
|
@@ -133,8 +173,12 @@ export const ProgressIndicator = ({
|
|
|
133
173
|
style={{
|
|
134
174
|
strokeLinecap: 'round',
|
|
135
175
|
}}
|
|
136
|
-
initial=
|
|
137
|
-
|
|
176
|
+
initial={
|
|
177
|
+
variant === 'circular-indeterminate' ? 'hidden' : 'determinate'
|
|
178
|
+
}
|
|
179
|
+
animate={
|
|
180
|
+
variant === 'circular-indeterminate' ? 'visible' : 'determinate'
|
|
181
|
+
}
|
|
138
182
|
className={styles.activeIndicator}
|
|
139
183
|
variants={{
|
|
140
184
|
hidden: {
|
|
@@ -143,14 +187,24 @@ export const ProgressIndicator = ({
|
|
|
143
187
|
visible: {
|
|
144
188
|
pathLength: togglePercentage ? 90 / 100 : 10 / 100,
|
|
145
189
|
},
|
|
190
|
+
determinate: {
|
|
191
|
+
pathLength: completedPercentage / 100,
|
|
192
|
+
},
|
|
146
193
|
}}
|
|
147
194
|
transition={{
|
|
148
|
-
pathLength:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
195
|
+
pathLength:
|
|
196
|
+
variant === 'circular-indeterminate'
|
|
197
|
+
? {
|
|
198
|
+
type: 'tween',
|
|
199
|
+
ease: 'linear',
|
|
200
|
+
duration: getTransitionRotate(),
|
|
201
|
+
bounce: 0,
|
|
202
|
+
}
|
|
203
|
+
: {
|
|
204
|
+
type: 'tween',
|
|
205
|
+
ease: 'easeInOut',
|
|
206
|
+
duration: transitionDuration / 1000,
|
|
207
|
+
},
|
|
154
208
|
}}
|
|
155
209
|
/>
|
|
156
210
|
</motion.svg>
|
|
@@ -2,10 +2,17 @@ import {
|
|
|
2
2
|
type API,
|
|
3
3
|
type ConfigInterface,
|
|
4
4
|
ContextOptions,
|
|
5
|
+
FontPlugin,
|
|
5
6
|
loader,
|
|
7
|
+
serializeThemeContext,
|
|
6
8
|
} from '@udixio/theme';
|
|
7
9
|
import { useEffect, useRef, useState } from 'react';
|
|
8
10
|
import { TailwindPlugin } from '@udixio/tailwind';
|
|
11
|
+
import type {
|
|
12
|
+
WorkerInboundMessage,
|
|
13
|
+
WorkerOutboundMessage,
|
|
14
|
+
} from './theme.worker';
|
|
15
|
+
import ThemeWorker from './theme.worker?worker&inline';
|
|
9
16
|
|
|
10
17
|
function isValidHexColor(hexColorString: string) {
|
|
11
18
|
const regex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
@@ -14,7 +21,7 @@ function isValidHexColor(hexColorString: string) {
|
|
|
14
21
|
|
|
15
22
|
export const ThemeProvider = ({
|
|
16
23
|
config,
|
|
17
|
-
throttleDelay = 100,
|
|
24
|
+
throttleDelay = 100,
|
|
18
25
|
onLoad,
|
|
19
26
|
loadTheme = false,
|
|
20
27
|
}: {
|
|
@@ -24,16 +31,48 @@ export const ThemeProvider = ({
|
|
|
24
31
|
loadTheme?: boolean;
|
|
25
32
|
}) => {
|
|
26
33
|
const [themeApi, setThemeApi] = useState<API | null>(null);
|
|
34
|
+
const [outputCss, setOutputCss] = useState<string | null>(null);
|
|
35
|
+
|
|
36
|
+
const workerRef = useRef<Worker | null>(null);
|
|
37
|
+
const generationRef = useRef(0);
|
|
38
|
+
const lastAppliedIdRef = useRef(0);
|
|
39
|
+
const themeApiRef = useRef<API | null>(null);
|
|
40
|
+
const firstLoadDoneRef = useRef(false);
|
|
41
|
+
const onLoadRef = useRef(onLoad);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
onLoadRef.current = onLoad;
|
|
44
|
+
}, [onLoad]);
|
|
27
45
|
|
|
28
|
-
//
|
|
46
|
+
// Initialisation de l'API et du Worker
|
|
29
47
|
useEffect(() => {
|
|
48
|
+
let cancelled = false;
|
|
49
|
+
|
|
30
50
|
(async () => {
|
|
31
51
|
const api = await loader(config, loadTheme);
|
|
52
|
+
if (cancelled) return;
|
|
53
|
+
|
|
54
|
+
themeApiRef.current = api;
|
|
32
55
|
setThemeApi(api);
|
|
56
|
+
|
|
57
|
+
const worker = new ThemeWorker() as Worker;
|
|
58
|
+
workerRef.current = worker;
|
|
59
|
+
|
|
60
|
+
worker.onmessage = (e: MessageEvent<WorkerOutboundMessage>) => {
|
|
61
|
+
if (e.data.id > lastAppliedIdRef.current) {
|
|
62
|
+
lastAppliedIdRef.current = e.data.id;
|
|
63
|
+
firstLoadDoneRef.current = true;
|
|
64
|
+
setOutputCss(e.data.css);
|
|
65
|
+
onLoadRef.current?.(themeApiRef.current!);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
33
68
|
})();
|
|
34
|
-
}, []);
|
|
35
69
|
|
|
36
|
-
|
|
70
|
+
return () => {
|
|
71
|
+
cancelled = true;
|
|
72
|
+
workerRef.current?.terminate();
|
|
73
|
+
workerRef.current = null;
|
|
74
|
+
};
|
|
75
|
+
}, []);
|
|
37
76
|
|
|
38
77
|
// Throttle avec exécution en tête (leading) et en fin (trailing)
|
|
39
78
|
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
@@ -41,11 +80,10 @@ export const ThemeProvider = ({
|
|
|
41
80
|
const lastArgsRef = useRef<Partial<ContextOptions> | null>(null);
|
|
42
81
|
|
|
43
82
|
useEffect(() => {
|
|
44
|
-
if (!themeApi) return;
|
|
83
|
+
if (!themeApi) return;
|
|
45
84
|
|
|
46
85
|
const ctx: Partial<ContextOptions> = {
|
|
47
86
|
...config,
|
|
48
|
-
// Assurer la compatibilité avec l'API qui attend sourceColorHex
|
|
49
87
|
sourceColor: config.sourceColor,
|
|
50
88
|
};
|
|
51
89
|
|
|
@@ -53,11 +91,9 @@ export const ThemeProvider = ({
|
|
|
53
91
|
const timeSinceLast = now - lastExecTimeRef.current;
|
|
54
92
|
|
|
55
93
|
const invoke = async (args: Partial<ContextOptions>) => {
|
|
56
|
-
// applique et notifie
|
|
57
94
|
await applyThemeChange(args);
|
|
58
95
|
};
|
|
59
96
|
|
|
60
|
-
// Leading: si délai écoulé ou jamais exécuté, exécuter tout de suite
|
|
61
97
|
if (lastExecTimeRef.current === 0 || timeSinceLast >= throttleDelay) {
|
|
62
98
|
if (timeoutRef.current) {
|
|
63
99
|
clearTimeout(timeoutRef.current);
|
|
@@ -67,7 +103,6 @@ export const ThemeProvider = ({
|
|
|
67
103
|
lastExecTimeRef.current = now;
|
|
68
104
|
void invoke(ctx);
|
|
69
105
|
} else {
|
|
70
|
-
// Sinon, mémoriser la dernière requête et programmer une exécution en trailing
|
|
71
106
|
lastArgsRef.current = ctx;
|
|
72
107
|
if (!timeoutRef.current) {
|
|
73
108
|
const remaining = Math.max(0, throttleDelay - timeSinceLast);
|
|
@@ -83,34 +118,43 @@ export const ThemeProvider = ({
|
|
|
83
118
|
}
|
|
84
119
|
}
|
|
85
120
|
|
|
86
|
-
// Cleanup: au changement de dépendances, ne rien faire ici (on gère trailing)
|
|
87
121
|
return () => {};
|
|
88
122
|
}, [config, throttleDelay, themeApi]);
|
|
89
123
|
|
|
90
124
|
const applyThemeChange = async (ctx: Partial<ContextOptions>) => {
|
|
91
|
-
if (typeof ctx.sourceColor
|
|
92
|
-
|
|
93
|
-
throw new Error('Invalid hex color');
|
|
94
|
-
}
|
|
125
|
+
if (typeof ctx.sourceColor === 'string' && !isValidHexColor(ctx.sourceColor)) {
|
|
126
|
+
throw new Error('Invalid hex color');
|
|
95
127
|
}
|
|
96
128
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
129
|
+
const api = themeApiRef.current;
|
|
130
|
+
if (!api) return;
|
|
131
|
+
|
|
132
|
+
// Toujours évaluer sur le main thread (rapide)
|
|
133
|
+
api.context.update(ctx);
|
|
134
|
+
api.palettes.sync((ctx as any).palettes);
|
|
102
135
|
|
|
103
|
-
|
|
136
|
+
const worker = workerRef.current;
|
|
104
137
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
|
|
138
|
+
// Fallback synchrone : premier rendu ou Worker pas encore prêt
|
|
139
|
+
if (!worker || !firstLoadDoneRef.current) {
|
|
140
|
+
await api.load();
|
|
141
|
+
const css = api.plugins.getPlugin(TailwindPlugin).getInstance().outputCss;
|
|
142
|
+
setOutputCss(css);
|
|
143
|
+
firstLoadDoneRef.current = true;
|
|
144
|
+
onLoad?.(api);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
109
147
|
|
|
110
|
-
|
|
148
|
+
// Offload au Worker
|
|
149
|
+
const id = ++generationRef.current;
|
|
150
|
+
worker.postMessage({
|
|
151
|
+
id,
|
|
152
|
+
snapshot: serializeThemeContext(api),
|
|
153
|
+
tailwindOptions: api.plugins.getPlugin(TailwindPlugin).options,
|
|
154
|
+
fontOptions: api.plugins.getPlugin(FontPlugin).options,
|
|
155
|
+
} satisfies WorkerInboundMessage);
|
|
111
156
|
};
|
|
112
157
|
|
|
113
|
-
// Cleanup lors du démontage du composant
|
|
114
158
|
useEffect(() => {
|
|
115
159
|
return () => {
|
|
116
160
|
if (timeoutRef.current) {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loader,
|
|
3
|
+
getVariantByName,
|
|
4
|
+
Hct,
|
|
5
|
+
FontPlugin,
|
|
6
|
+
} from '@udixio/theme';
|
|
7
|
+
import type { API, FontPluginOptions, ThemeContextSnapshot } from '@udixio/theme';
|
|
8
|
+
import { TailwindPlugin } from '@udixio/tailwind';
|
|
9
|
+
import type { TailwindPluginOptions } from '@udixio/tailwind';
|
|
10
|
+
|
|
11
|
+
export interface WorkerInboundMessage {
|
|
12
|
+
id: number;
|
|
13
|
+
snapshot: ThemeContextSnapshot;
|
|
14
|
+
tailwindOptions: TailwindPluginOptions;
|
|
15
|
+
fontOptions: FontPluginOptions;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface WorkerOutboundMessage {
|
|
19
|
+
id: number;
|
|
20
|
+
css: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let workerApi: API | null = null;
|
|
24
|
+
let latestMessage: WorkerInboundMessage | null = null;
|
|
25
|
+
let processing = false;
|
|
26
|
+
|
|
27
|
+
async function processLatest() {
|
|
28
|
+
if (processing || !latestMessage) return;
|
|
29
|
+
processing = true;
|
|
30
|
+
|
|
31
|
+
const msg = latestMessage;
|
|
32
|
+
latestMessage = null;
|
|
33
|
+
|
|
34
|
+
const { snapshot, tailwindOptions, fontOptions } = msg;
|
|
35
|
+
|
|
36
|
+
const palettesCallbacks = Object.fromEntries(
|
|
37
|
+
Object.entries(snapshot.palettes).map(([key, { hue, chroma }]) => [
|
|
38
|
+
key,
|
|
39
|
+
() => ({ hue, chroma }),
|
|
40
|
+
]),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
if (!workerApi) {
|
|
45
|
+
// Initialisation unique — coût amorti sur tous les messages suivants
|
|
46
|
+
workerApi = await loader(
|
|
47
|
+
{
|
|
48
|
+
sourceColor: Hct.from(
|
|
49
|
+
snapshot.sourceColor.hue,
|
|
50
|
+
snapshot.sourceColor.chroma,
|
|
51
|
+
snapshot.sourceColor.tone,
|
|
52
|
+
),
|
|
53
|
+
isDark: snapshot.isDark,
|
|
54
|
+
contrastLevel: snapshot.contrastLevel,
|
|
55
|
+
variant: getVariantByName(snapshot.variantName),
|
|
56
|
+
plugins: [new FontPlugin(fontOptions), new TailwindPlugin(tailwindOptions)],
|
|
57
|
+
},
|
|
58
|
+
false,
|
|
59
|
+
);
|
|
60
|
+
workerApi.palettes.sync(palettesCallbacks);
|
|
61
|
+
} else {
|
|
62
|
+
// Mise à jour légère — pas de re-bootstrap
|
|
63
|
+
workerApi.context.update({
|
|
64
|
+
isDark: snapshot.isDark,
|
|
65
|
+
contrastLevel: snapshot.contrastLevel,
|
|
66
|
+
sourceColor: Hct.from(
|
|
67
|
+
snapshot.sourceColor.hue,
|
|
68
|
+
snapshot.sourceColor.chroma,
|
|
69
|
+
snapshot.sourceColor.tone,
|
|
70
|
+
),
|
|
71
|
+
variant: getVariantByName(snapshot.variantName),
|
|
72
|
+
});
|
|
73
|
+
workerApi.palettes.sync(palettesCallbacks);
|
|
74
|
+
|
|
75
|
+
// Mise à jour des options plugins si elles ont changé
|
|
76
|
+
workerApi.plugins.getPlugin(TailwindPlugin).options = tailwindOptions;
|
|
77
|
+
workerApi.plugins.getPlugin(FontPlugin).options = fontOptions;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
await workerApi.load();
|
|
81
|
+
|
|
82
|
+
const css = workerApi.plugins.getPlugin(TailwindPlugin).getInstance().outputCss;
|
|
83
|
+
self.postMessage({ id: msg.id, css } satisfies WorkerOutboundMessage);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
console.error('[Worker] error during processLatest:', e);
|
|
86
|
+
workerApi = null; // reset state for clean retry
|
|
87
|
+
} finally {
|
|
88
|
+
processing = false;
|
|
89
|
+
// Traite le prochain message s'il est arrivé pendant le traitement
|
|
90
|
+
processLatest();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
self.onmessage = (event: MessageEvent<WorkerInboundMessage>) => {
|
|
95
|
+
latestMessage = event.data;
|
|
96
|
+
processLatest();
|
|
97
|
+
};
|
|
@@ -31,5 +31,11 @@ export interface ProgressIndicatorInterface {
|
|
|
31
31
|
};
|
|
32
32
|
states: { isVisible: boolean };
|
|
33
33
|
|
|
34
|
-
elements: [
|
|
34
|
+
elements: [
|
|
35
|
+
'progressIndicator',
|
|
36
|
+
'stop',
|
|
37
|
+
'activeIndicator',
|
|
38
|
+
'lastTrack',
|
|
39
|
+
'firstTrack',
|
|
40
|
+
];
|
|
35
41
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
const cardConfig: ClassNameComponent<CardInterface> = ({
|
|
10
10
|
variant,
|
|
11
|
-
|
|
11
|
+
interactive,
|
|
12
12
|
}) => ({
|
|
13
13
|
card: classNames(
|
|
14
14
|
' rounded-xl overflow-hidden ',
|
|
@@ -16,7 +16,7 @@ const cardConfig: ClassNameComponent<CardInterface> = ({
|
|
|
16
16
|
variant === 'elevated' && 'bg-surface-container-low shadow-1',
|
|
17
17
|
variant === 'filled' && 'bg-surface-container-highest',
|
|
18
18
|
{
|
|
19
|
-
'group/card':
|
|
19
|
+
'group/card cursor-pointer': interactive,
|
|
20
20
|
},
|
|
21
21
|
),
|
|
22
22
|
});
|
|
@@ -6,13 +6,9 @@ import {
|
|
|
6
6
|
defaultClassNames,
|
|
7
7
|
} from '../utils';
|
|
8
8
|
|
|
9
|
-
export const carouselItemConfig: ClassNameComponent<CarouselItemInterface> = ({
|
|
10
|
-
width,
|
|
11
|
-
}) => {
|
|
9
|
+
export const carouselItemConfig: ClassNameComponent<CarouselItemInterface> = () => {
|
|
12
10
|
return {
|
|
13
11
|
carouselItem: classNames('rounded-[28px] overflow-hidden flex-none', {
|
|
14
|
-
hidden: width === undefined,
|
|
15
|
-
'flex-1': width == null,
|
|
16
12
|
}),
|
|
17
13
|
};
|
|
18
14
|
};
|
|
@@ -12,19 +12,27 @@ const progressIndicatorConfig: ClassNameComponent<
|
|
|
12
12
|
progressIndicator: classNames(
|
|
13
13
|
(variant === 'linear-determinate' || variant == 'linear-indeterminate') &&
|
|
14
14
|
'flex w-full h-1',
|
|
15
|
+
variant === 'linear-indeterminate' &&
|
|
16
|
+
'relative overflow-hidden rounded-full',
|
|
15
17
|
),
|
|
16
|
-
|
|
17
|
-
'
|
|
18
|
-
|
|
19
|
-
}),
|
|
20
|
-
activeIndicator: classNames(
|
|
18
|
+
firstTrack: classNames(
|
|
19
|
+
(variant === 'linear-determinate' || variant === 'linear-indeterminate') &&
|
|
20
|
+
'h-full rounded-full bg-primary-container',
|
|
21
21
|
{
|
|
22
22
|
'max-h-0': !isVisible,
|
|
23
23
|
'max-h-full': isVisible,
|
|
24
24
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
),
|
|
26
|
+
activeIndicator: classNames(
|
|
27
|
+
'h-full rounded-full bg-primary',
|
|
28
|
+
variant === 'linear-determinate' && {
|
|
29
|
+
'rounded-l-full': true,
|
|
30
|
+
},
|
|
31
|
+
(variant === 'linear-indeterminate' ||
|
|
32
|
+
variant === 'linear-determinate') && {
|
|
33
|
+
'max-h-0': !isVisible,
|
|
34
|
+
'max-h-full': isVisible,
|
|
35
|
+
},
|
|
28
36
|
(variant === 'circular-determinate' ||
|
|
29
37
|
variant == 'circular-indeterminate') && [
|
|
30
38
|
'stroke-primary fill-transparent ',
|
|
@@ -34,6 +42,14 @@ const progressIndicatorConfig: ClassNameComponent<
|
|
|
34
42
|
},
|
|
35
43
|
],
|
|
36
44
|
),
|
|
45
|
+
lastTrack: classNames(
|
|
46
|
+
(variant === 'linear-determinate' || variant == 'linear-indeterminate') &&
|
|
47
|
+
'h-full flex-1 rounded-full bg-primary-container',
|
|
48
|
+
{
|
|
49
|
+
'max-h-0': !isVisible,
|
|
50
|
+
'max-h-full': isVisible,
|
|
51
|
+
},
|
|
52
|
+
),
|
|
37
53
|
stop: classNames(
|
|
38
54
|
'absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1',
|
|
39
55
|
{
|
package/vite.config.ts
CHANGED
|
@@ -32,10 +32,6 @@ export default defineConfig(async () => ({
|
|
|
32
32
|
brotliSize: true,
|
|
33
33
|
}),
|
|
34
34
|
],
|
|
35
|
-
// Uncomment this if you are using workers.
|
|
36
|
-
// worker: {
|
|
37
|
-
// plugins: [ nxViteTsPaths() ],
|
|
38
|
-
// },
|
|
39
35
|
// Configuration for building your library.
|
|
40
36
|
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
41
37
|
build: {
|