@elogroup-sereduc/portal-aluno-tour 1.0.7 → 1.0.9

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 CHANGED
@@ -39,12 +39,12 @@ function MyComponent() {
39
39
 
40
40
  const steps = [
41
41
  {
42
- element: ".my-element",
42
+ element: "my-element", // Usa data-onboard="my-element"
43
43
  intro: "Este é o primeiro passo do tour",
44
44
  position: "bottom",
45
45
  },
46
46
  {
47
- element: ".another-element",
47
+ element: ".another-element", // Seletor CSS também funciona
48
48
  intro: "Este é o segundo passo",
49
49
  position: "right",
50
50
  },
@@ -82,7 +82,11 @@ function MyComponent() {
82
82
 
83
83
  ### TourStep
84
84
 
85
- - `element: string` - Seletor CSS do elemento
85
+ - `element: string` - Seletor CSS do elemento ou valor do atributo `data-onboard`
86
+ - Se começar com `.`, `#`, `[`, `:`, `>`, `+`, `~`, ou espaço: usa como seletor CSS
87
+ - Caso contrário: busca `[data-onboard="valor"]`
88
+ - Exemplo: `element: "student-card"` busca `[data-onboard="student-card"]`
89
+ - Exemplo: `element: ".my-class"` usa o seletor CSS `.my-class`
86
90
  - `intro: string` - Texto explicativo
87
91
  - `position?: "top" | "bottom" | "left" | "right"` - Posição da tooltip
88
92
  - `title?: string` - Título do passo (opcional)
@@ -1 +1 @@
1
- {"version":3,"file":"Tour.d.ts","sourceRoot":"","sources":["../../src/components/Tour.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,KAAK,EACL,WAAe,EACf,OAAY,EACZ,MAAM,EACN,UAAU,GACX,EAAE,SAAS,kDA0iBX"}
1
+ {"version":3,"file":"Tour.d.ts","sourceRoot":"","sources":["../../src/components/Tour.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,KAAK,EACL,WAAe,EACf,OAAY,EACZ,MAAM,EACN,UAAU,GACX,EAAE,SAAS,kDA8mBX"}
@@ -17,7 +17,7 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
17
17
  // Calcula a posição da tooltip baseado no elemento destacado
18
18
  // Usa getBoundingClientRect() que retorna posições relativas à viewport
19
19
  // Isso mantém a tooltip sempre visível mesmo durante scroll
20
- const calculateTooltipPosition = useCallback((element, position = "bottom") => {
20
+ const calculateTooltipPosition = useCallback((element, position = "auto") => {
21
21
  const rect = element.getBoundingClientRect();
22
22
  const viewportWidth = window.innerWidth;
23
23
  const viewportHeight = window.innerHeight;
@@ -62,8 +62,63 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
62
62
  }
63
63
  return { top, left, position: finalPosition };
64
64
  }
65
- // Elemento está visível - calcula posição normal próxima ao elemento
66
- switch (position) {
65
+ // Calcula espaço disponível em todas as direções
66
+ const spaceAbove = rect.top;
67
+ const spaceBelow = viewportHeight - rect.bottom;
68
+ const spaceLeft = rect.left;
69
+ const spaceRight = viewportWidth - rect.right;
70
+ // Determina a melhor posição baseado no espaço disponível
71
+ let bestPosition;
72
+ // Se position for "auto" ou não especificado, calcula automaticamente a melhor posição
73
+ if (!position || position === "auto") {
74
+ // Escolhe automaticamente a direção com mais espaço disponível
75
+ const maxSpace = Math.max(spaceAbove, spaceBelow, spaceLeft, spaceRight);
76
+ if (maxSpace === spaceAbove)
77
+ bestPosition = "top";
78
+ else if (maxSpace === spaceBelow)
79
+ bestPosition = "bottom";
80
+ else if (maxSpace === spaceLeft)
81
+ bestPosition = "left";
82
+ else
83
+ bestPosition = "right";
84
+ }
85
+ else {
86
+ // Posição específica foi fornecida - tenta usar ela primeiro
87
+ // Verifica se a posição especificada tem espaço suficiente
88
+ const hasEnoughSpace = (position === "top" && spaceAbove >= tooltipHeight + spacing + 8) ||
89
+ (position === "bottom" && spaceBelow >= tooltipHeight + spacing + 8) ||
90
+ (position === "left" && spaceLeft >= tooltipWidth + spacing + 8) ||
91
+ (position === "right" && spaceRight >= tooltipWidth + spacing + 8);
92
+ if (hasEnoughSpace) {
93
+ // Tem espaço suficiente, usa a posição especificada
94
+ bestPosition = position;
95
+ }
96
+ else {
97
+ // Não tem espaço suficiente na posição especificada, escolhe a melhor alternativa
98
+ // Para posições verticais (top/bottom), compara entre elas
99
+ if (position === "top" || position === "bottom") {
100
+ bestPosition = spaceAbove > spaceBelow ? "top" : "bottom";
101
+ }
102
+ // Para posições horizontais (left/right), compara entre elas
103
+ else if (position === "left" || position === "right") {
104
+ bestPosition = spaceLeft > spaceRight ? "left" : "right";
105
+ }
106
+ // Fallback: escolhe a direção com mais espaço
107
+ else {
108
+ const maxSpace = Math.max(spaceAbove, spaceBelow, spaceLeft, spaceRight);
109
+ if (maxSpace === spaceAbove)
110
+ bestPosition = "top";
111
+ else if (maxSpace === spaceBelow)
112
+ bestPosition = "bottom";
113
+ else if (maxSpace === spaceLeft)
114
+ bestPosition = "left";
115
+ else
116
+ bestPosition = "right";
117
+ }
118
+ }
119
+ }
120
+ // Calcula posição base na melhor direção escolhida
121
+ switch (bestPosition) {
67
122
  case "top":
68
123
  top = rect.top - spacing;
69
124
  left = rect.left + rect.width / 2;
@@ -74,7 +129,9 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
74
129
  break;
75
130
  case "left":
76
131
  top = rect.top + rect.height / 2;
77
- left = rect.left - spacing;
132
+ // Para left, a tooltip fica à esquerda do elemento
133
+ // left é onde a tooltip termina (borda direita), então subtrai a largura
134
+ left = rect.left - tooltipWidth - spacing;
78
135
  break;
79
136
  case "right":
80
137
  top = rect.top + rect.height / 2;
@@ -83,8 +140,9 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
83
140
  default:
84
141
  top = rect.bottom + spacing;
85
142
  left = rect.left + rect.width / 2;
86
- finalPosition = "bottom";
143
+ bestPosition = "bottom";
87
144
  }
145
+ finalPosition = bestPosition;
88
146
  // Ajusta horizontalmente para tooltips top/bottom - mantém próximo ao elemento
89
147
  if (finalPosition === "bottom" || finalPosition === "top") {
90
148
  // Centraliza no elemento, mas ajusta apenas se necessário para não sair da tela
@@ -153,28 +211,32 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
153
211
  if (spaceLeft < tooltipWidth + spacing + 8) {
154
212
  const spaceRight = viewportWidth - rect.right;
155
213
  if (spaceRight > spaceLeft && spaceRight > tooltipWidth + spacing + 8) {
214
+ // Muda para direita se houver mais espaço
156
215
  left = rect.right + spacing;
157
216
  finalPosition = "right";
158
217
  }
159
218
  else {
160
- // Mantém próximo ao elemento mesmo se não couber perfeitamente
161
- left = rect.left - spacing;
219
+ // Mantém à esquerda, mas ajusta para ficar visível
220
+ left = Math.max(8, rect.left - tooltipWidth - spacing);
162
221
  }
163
222
  }
223
+ // Se tem espaço suficiente, o left já foi calculado corretamente no switch acima
164
224
  }
165
225
  else if (finalPosition === "right") {
166
226
  const spaceRight = viewportWidth - rect.right;
167
227
  if (spaceRight < tooltipWidth + spacing + 8) {
168
228
  const spaceLeft = rect.left;
169
229
  if (spaceLeft > spaceRight && spaceLeft > tooltipWidth + spacing + 8) {
170
- left = rect.left - spacing;
230
+ // Muda para esquerda se houver mais espaço
231
+ left = rect.left - tooltipWidth - spacing;
171
232
  finalPosition = "left";
172
233
  }
173
234
  else {
174
- // Mantém próximo ao elemento mesmo se não couber perfeitamente
175
- left = rect.right + spacing;
235
+ // Mantém à direita, mas ajusta para ficar visível
236
+ left = Math.min(viewportWidth - tooltipWidth - 8, rect.right + spacing);
176
237
  }
177
238
  }
239
+ // Se tem espaço suficiente, o left já foi calculado corretamente no switch acima
178
240
  }
179
241
  }
180
242
  return { top, left, position: finalPosition };
@@ -196,6 +258,15 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
196
258
  setTooltipPosition(null);
197
259
  }
198
260
  }, [enabled, steps.length, isVisible, initialStep]);
261
+ // Função auxiliar para buscar elemento por seletor CSS ou data-onboard
262
+ const findElement = useCallback((selector) => {
263
+ // Se o seletor começa com caracteres de seletor CSS (. # [ etc), usa diretamente
264
+ if (/^[.#\[:>+\s~]/.test(selector)) {
265
+ return document.querySelector(selector);
266
+ }
267
+ // Caso contrário, assume que é um valor de data-onboard
268
+ return document.querySelector(`[data-onboard="${selector}"]`);
269
+ }, []);
199
270
  // Destaca o elemento atual
200
271
  useEffect(() => {
201
272
  if (!isVisible || currentStep < 0 || currentStep >= steps.length) {
@@ -204,9 +275,9 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
204
275
  return;
205
276
  }
206
277
  const step = steps[currentStep];
207
- const element = document.querySelector(step.element);
278
+ const element = findElement(step.element);
208
279
  if (!element) {
209
- console.warn(`Elemento não encontrado: ${step.element}`);
280
+ console.warn(`Elemento não encontrado: ${step.element}. Tentando buscar [data-onboard="${step.element}"]`);
210
281
  return;
211
282
  }
212
283
  setHighlightedElement(element);
@@ -216,7 +287,8 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
216
287
  const updatePosition = () => {
217
288
  const updatedRect = element.getBoundingClientRect();
218
289
  if (updatedRect.width > 0 && updatedRect.height > 0) {
219
- const position = calculateTooltipPosition(element, step.position || "bottom");
290
+ // Usa "auto" como default se position não for especificado
291
+ const position = calculateTooltipPosition(element, step.position || "auto");
220
292
  setTooltipPosition(position);
221
293
  }
222
294
  };
@@ -239,7 +311,7 @@ export function Tour({ enabled, steps, initialStep = 0, options = {}, onExit, on
239
311
  window.removeEventListener("resize", handleResize);
240
312
  document.removeEventListener("scroll", handleScroll, true);
241
313
  };
242
- }, [isVisible, currentStep, steps, calculateTooltipPosition]);
314
+ }, [isVisible, currentStep, steps, calculateTooltipPosition, findElement]);
243
315
  // Adiciona overlay e highlight ao elemento
244
316
  useEffect(() => {
245
317
  if (!highlightedElement) {
@@ -3,7 +3,9 @@
3
3
  */
4
4
  export interface TourStep {
5
5
  /**
6
- * Seletor CSS do elemento a ser destacado
6
+ * Seletor CSS do elemento a ser destacado ou valor do atributo data-onboard
7
+ * - Se for um seletor CSS (começa com ., #, [, etc.), será usado diretamente
8
+ * - Caso contrário, será usado como valor do atributo data-onboard: [data-onboard="valor"]
7
9
  */
8
10
  element: string;
9
11
  /**
@@ -12,9 +14,11 @@ export interface TourStep {
12
14
  intro: string;
13
15
  /**
14
16
  * Posição da tooltip em relação ao elemento
15
- * @default "bottom"
17
+ * - "auto": Calcula automaticamente a melhor posição baseada no espaço disponível
18
+ * - "top" | "bottom" | "left" | "right": Posição específica (pode ser ajustada se não houver espaço)
19
+ * @default "auto"
16
20
  */
17
- position?: "top" | "bottom" | "left" | "right";
21
+ position?: "auto" | "top" | "bottom" | "left" | "right";
18
22
  /**
19
23
  * Título do passo (opcional)
20
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAE/C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAExD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elogroup-sereduc/portal-aluno-tour",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Componente de tour guiado customizado usando HeroUI para o Portal do Aluno",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,5 +39,4 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  }
42
- }
43
-
42
+ }
@@ -36,11 +36,11 @@ export function Tour({
36
36
  // Calcula a posição da tooltip baseado no elemento destacado
37
37
  // Usa getBoundingClientRect() que retorna posições relativas à viewport
38
38
  // Isso mantém a tooltip sempre visível mesmo durante scroll
39
- const calculateTooltipPosition = useCallback((element: HTMLElement, position: string = "bottom") => {
39
+ const calculateTooltipPosition = useCallback((element: HTMLElement, position: string | undefined = "auto") => {
40
40
  const rect = element.getBoundingClientRect();
41
41
  const viewportWidth = window.innerWidth;
42
42
  const viewportHeight = window.innerHeight;
43
-
43
+
44
44
  // Tamanho estimado da tooltip
45
45
  const tooltipWidth = 384; // max-w-sm = 384px
46
46
  const tooltipHeight = 250; // altura estimada
@@ -51,10 +51,10 @@ export function Tour({
51
51
  let finalPosition = position;
52
52
 
53
53
  // Verifica se o elemento está visível na viewport
54
- const isElementVisible =
55
- rect.top < viewportHeight &&
56
- rect.bottom > 0 &&
57
- rect.left < viewportWidth &&
54
+ const isElementVisible =
55
+ rect.top < viewportHeight &&
56
+ rect.bottom > 0 &&
57
+ rect.left < viewportWidth &&
58
58
  rect.right > 0;
59
59
 
60
60
  // Se o elemento não estiver visível, tenta posicionar próximo à borda mais próxima
@@ -84,8 +84,58 @@ export function Tour({
84
84
  return { top, left, position: finalPosition };
85
85
  }
86
86
 
87
- // Elemento está visível - calcula posição normal próxima ao elemento
88
- switch (position) {
87
+ // Calcula espaço disponível em todas as direções
88
+ const spaceAbove = rect.top;
89
+ const spaceBelow = viewportHeight - rect.bottom;
90
+ const spaceLeft = rect.left;
91
+ const spaceRight = viewportWidth - rect.right;
92
+
93
+ // Determina a melhor posição baseado no espaço disponível
94
+ let bestPosition: "top" | "bottom" | "left" | "right";
95
+
96
+ // Se position for "auto" ou não especificado, calcula automaticamente a melhor posição
97
+ if (!position || position === "auto") {
98
+ // Escolhe automaticamente a direção com mais espaço disponível
99
+ const maxSpace = Math.max(spaceAbove, spaceBelow, spaceLeft, spaceRight);
100
+ if (maxSpace === spaceAbove) bestPosition = "top";
101
+ else if (maxSpace === spaceBelow) bestPosition = "bottom";
102
+ else if (maxSpace === spaceLeft) bestPosition = "left";
103
+ else bestPosition = "right";
104
+ } else {
105
+ // Posição específica foi fornecida - tenta usar ela primeiro
106
+ // Verifica se a posição especificada tem espaço suficiente
107
+ const hasEnoughSpace =
108
+ (position === "top" && spaceAbove >= tooltipHeight + spacing + 8) ||
109
+ (position === "bottom" && spaceBelow >= tooltipHeight + spacing + 8) ||
110
+ (position === "left" && spaceLeft >= tooltipWidth + spacing + 8) ||
111
+ (position === "right" && spaceRight >= tooltipWidth + spacing + 8);
112
+
113
+ if (hasEnoughSpace) {
114
+ // Tem espaço suficiente, usa a posição especificada
115
+ bestPosition = position as "top" | "bottom" | "left" | "right";
116
+ } else {
117
+ // Não tem espaço suficiente na posição especificada, escolhe a melhor alternativa
118
+ // Para posições verticais (top/bottom), compara entre elas
119
+ if (position === "top" || position === "bottom") {
120
+ bestPosition = spaceAbove > spaceBelow ? "top" : "bottom";
121
+ }
122
+ // Para posições horizontais (left/right), compara entre elas
123
+ else if (position === "left" || position === "right") {
124
+ bestPosition = spaceLeft > spaceRight ? "left" : "right";
125
+ }
126
+ // Fallback: escolhe a direção com mais espaço
127
+ else {
128
+ const maxSpace = Math.max(spaceAbove, spaceBelow, spaceLeft, spaceRight);
129
+ if (maxSpace === spaceAbove) bestPosition = "top";
130
+ else if (maxSpace === spaceBelow) bestPosition = "bottom";
131
+ else if (maxSpace === spaceLeft) bestPosition = "left";
132
+ else bestPosition = "right";
133
+ }
134
+ }
135
+ }
136
+
137
+ // Calcula posição base na melhor direção escolhida
138
+ switch (bestPosition) {
89
139
  case "top":
90
140
  top = rect.top - spacing;
91
141
  left = rect.left + rect.width / 2;
@@ -96,7 +146,9 @@ export function Tour({
96
146
  break;
97
147
  case "left":
98
148
  top = rect.top + rect.height / 2;
99
- left = rect.left - spacing;
149
+ // Para left, a tooltip fica à esquerda do elemento
150
+ // left é onde a tooltip termina (borda direita), então subtrai a largura
151
+ left = rect.left - tooltipWidth - spacing;
100
152
  break;
101
153
  case "right":
102
154
  top = rect.top + rect.height / 2;
@@ -105,16 +157,18 @@ export function Tour({
105
157
  default:
106
158
  top = rect.bottom + spacing;
107
159
  left = rect.left + rect.width / 2;
108
- finalPosition = "bottom";
160
+ bestPosition = "bottom";
109
161
  }
110
162
 
163
+ finalPosition = bestPosition;
164
+
111
165
  // Ajusta horizontalmente para tooltips top/bottom - mantém próximo ao elemento
112
166
  if (finalPosition === "bottom" || finalPosition === "top") {
113
167
  // Centraliza no elemento, mas ajusta apenas se necessário para não sair da tela
114
168
  const elementCenterX = rect.left + rect.width / 2;
115
169
  const minLeft = tooltipWidth / 2 + 8;
116
170
  const maxLeft = viewportWidth - tooltipWidth / 2 - 8;
117
-
171
+
118
172
  // Mantém o mais próximo possível do centro do elemento
119
173
  if (elementCenterX < minLeft) {
120
174
  left = minLeft;
@@ -123,7 +177,7 @@ export function Tour({
123
177
  } else {
124
178
  left = elementCenterX; // Mantém centralizado no elemento
125
179
  }
126
-
180
+
127
181
  // Verifica espaço vertical e ajusta posição se necessário
128
182
  if (finalPosition === "bottom") {
129
183
  const spaceBelow = viewportHeight - rect.bottom;
@@ -150,14 +204,14 @@ export function Tour({
150
204
  }
151
205
  }
152
206
  }
153
- }
207
+ }
154
208
  // Ajusta verticalmente para tooltips left/right - mantém próximo ao elemento
155
209
  else if (finalPosition === "left" || finalPosition === "right") {
156
210
  // Centraliza no elemento verticalmente
157
211
  const elementCenterY = rect.top + rect.height / 2;
158
212
  const minTop = tooltipHeight / 2 + 8;
159
213
  const maxTop = viewportHeight - tooltipHeight / 2 - 8;
160
-
214
+
161
215
  // Mantém o mais próximo possível do centro do elemento
162
216
  if (elementCenterY < minTop) {
163
217
  top = minTop;
@@ -166,32 +220,36 @@ export function Tour({
166
220
  } else {
167
221
  top = elementCenterY; // Mantém centralizado no elemento
168
222
  }
169
-
223
+
170
224
  // Verifica espaço horizontal e ajusta posição se necessário
171
225
  if (finalPosition === "left") {
172
226
  const spaceLeft = rect.left;
173
227
  if (spaceLeft < tooltipWidth + spacing + 8) {
174
228
  const spaceRight = viewportWidth - rect.right;
175
229
  if (spaceRight > spaceLeft && spaceRight > tooltipWidth + spacing + 8) {
230
+ // Muda para direita se houver mais espaço
176
231
  left = rect.right + spacing;
177
232
  finalPosition = "right";
178
233
  } else {
179
- // Mantém próximo ao elemento mesmo se não couber perfeitamente
180
- left = rect.left - spacing;
234
+ // Mantém à esquerda, mas ajusta para ficar visível
235
+ left = Math.max(8, rect.left - tooltipWidth - spacing);
181
236
  }
182
237
  }
238
+ // Se tem espaço suficiente, o left já foi calculado corretamente no switch acima
183
239
  } else if (finalPosition === "right") {
184
240
  const spaceRight = viewportWidth - rect.right;
185
241
  if (spaceRight < tooltipWidth + spacing + 8) {
186
242
  const spaceLeft = rect.left;
187
243
  if (spaceLeft > spaceRight && spaceLeft > tooltipWidth + spacing + 8) {
188
- left = rect.left - spacing;
244
+ // Muda para esquerda se houver mais espaço
245
+ left = rect.left - tooltipWidth - spacing;
189
246
  finalPosition = "left";
190
247
  } else {
191
- // Mantém próximo ao elemento mesmo se não couber perfeitamente
192
- left = rect.right + spacing;
248
+ // Mantém à direita, mas ajusta para ficar visível
249
+ left = Math.min(viewportWidth - tooltipWidth - 8, rect.right + spacing);
193
250
  }
194
251
  }
252
+ // Se tem espaço suficiente, o left já foi calculado corretamente no switch acima
195
253
  }
196
254
  }
197
255
 
@@ -216,6 +274,16 @@ export function Tour({
216
274
  }
217
275
  }, [enabled, steps.length, isVisible, initialStep]);
218
276
 
277
+ // Função auxiliar para buscar elemento por seletor CSS ou data-onboard
278
+ const findElement = useCallback((selector: string): HTMLElement | null => {
279
+ // Se o seletor começa com caracteres de seletor CSS (. # [ etc), usa diretamente
280
+ if (/^[.#\[:>+\s~]/.test(selector)) {
281
+ return document.querySelector(selector) as HTMLElement;
282
+ }
283
+ // Caso contrário, assume que é um valor de data-onboard
284
+ return document.querySelector(`[data-onboard="${selector}"]`) as HTMLElement;
285
+ }, []);
286
+
219
287
  // Destaca o elemento atual
220
288
  useEffect(() => {
221
289
  if (!isVisible || currentStep < 0 || currentStep >= steps.length) {
@@ -225,10 +293,10 @@ export function Tour({
225
293
  }
226
294
 
227
295
  const step = steps[currentStep];
228
- const element = document.querySelector(step.element) as HTMLElement;
296
+ const element = findElement(step.element);
229
297
 
230
298
  if (!element) {
231
- console.warn(`Elemento não encontrado: ${step.element}`);
299
+ console.warn(`Elemento não encontrado: ${step.element}. Tentando buscar [data-onboard="${step.element}"]`);
232
300
  return;
233
301
  }
234
302
 
@@ -241,7 +309,8 @@ export function Tour({
241
309
  const updatePosition = () => {
242
310
  const updatedRect = element.getBoundingClientRect();
243
311
  if (updatedRect.width > 0 && updatedRect.height > 0) {
244
- const position = calculateTooltipPosition(element, step.position || "bottom");
312
+ // Usa "auto" como default se position não for especificado
313
+ const position = calculateTooltipPosition(element, step.position || "auto");
245
314
  setTooltipPosition(position);
246
315
  }
247
316
  };
@@ -269,7 +338,7 @@ export function Tour({
269
338
  window.removeEventListener("resize", handleResize);
270
339
  document.removeEventListener("scroll", handleScroll, true);
271
340
  };
272
- }, [isVisible, currentStep, steps, calculateTooltipPosition]);
341
+ }, [isVisible, currentStep, steps, calculateTooltipPosition, findElement]);
273
342
 
274
343
  // Adiciona overlay e highlight ao elemento
275
344
  useEffect(() => {
@@ -466,11 +535,10 @@ export function Tour({
466
535
  <button
467
536
  key={index}
468
537
  onClick={() => setCurrentStep(index)}
469
- className={`tour:w-2 tour:h-2 tour:rounded-full tour:transition-all ${
470
- index === currentStep
538
+ className={`tour:w-2 tour:h-2 tour:rounded-full tour:transition-all ${index === currentStep
471
539
  ? "tour:bg-brand-primary tour:w-6"
472
540
  : "tour:bg-gray-300 tour:hover:bg-gray-400"
473
- }`}
541
+ }`}
474
542
  aria-label={`Ir para passo ${index + 1}`}
475
543
  />
476
544
  ))}
@@ -4,7 +4,9 @@
4
4
 
5
5
  export interface TourStep {
6
6
  /**
7
- * Seletor CSS do elemento a ser destacado
7
+ * Seletor CSS do elemento a ser destacado ou valor do atributo data-onboard
8
+ * - Se for um seletor CSS (começa com ., #, [, etc.), será usado diretamente
9
+ * - Caso contrário, será usado como valor do atributo data-onboard: [data-onboard="valor"]
8
10
  */
9
11
  element: string;
10
12
 
@@ -15,9 +17,11 @@ export interface TourStep {
15
17
 
16
18
  /**
17
19
  * Posição da tooltip em relação ao elemento
18
- * @default "bottom"
20
+ * - "auto": Calcula automaticamente a melhor posição baseada no espaço disponível
21
+ * - "top" | "bottom" | "left" | "right": Posição específica (pode ser ajustada se não houver espaço)
22
+ * @default "auto"
19
23
  */
20
- position?: "top" | "bottom" | "left" | "right";
24
+ position?: "auto" | "top" | "bottom" | "left" | "right";
21
25
 
22
26
  /**
23
27
  * Título do passo (opcional)
package/dist/tour.css DELETED
@@ -1,566 +0,0 @@
1
- /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
2
- @layer properties;
3
- @layer theme, base, components, utilities;
4
- @layer theme {
5
- :root, :host {
6
- --tour-color-gray-100: oklch(96.7% 0.003 264.542);
7
- --tour-color-gray-200: oklch(92.8% 0.006 264.531);
8
- --tour-color-gray-300: oklch(87.2% 0.01 258.338);
9
- --tour-color-gray-400: oklch(70.7% 0.022 261.325);
10
- --tour-color-gray-500: oklch(55.1% 0.027 264.364);
11
- --tour-color-gray-700: oklch(37.3% 0.034 259.733);
12
- --tour-color-gray-900: oklch(21% 0.034 264.665);
13
- --tour-color-white: #fff;
14
- --tour-spacing: 0.25rem;
15
- --tour-container-sm: 24rem;
16
- --tour-text-xs: 0.75rem;
17
- --tour-text-xs--line-height: calc(1 / 0.75);
18
- --tour-text-lg: 1.125rem;
19
- --tour-text-lg--line-height: calc(1.75 / 1.125);
20
- --tour-font-weight-semibold: 600;
21
- --tour-radius-lg: 0.5rem;
22
- }
23
- }
24
- @layer base {
25
- *, ::after, ::before, ::backdrop, ::file-selector-button {
26
- box-sizing: border-box;
27
- margin: 0;
28
- padding: 0;
29
- border: 0 solid;
30
- }
31
- html, :host {
32
- line-height: 1.5;
33
- -webkit-text-size-adjust: 100%;
34
- tab-size: 4;
35
- font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"), Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
36
- font-feature-settings: normal;
37
- font-variation-settings: normal;
38
- -webkit-tap-highlight-color: transparent;
39
- }
40
- hr {
41
- height: 0;
42
- color: inherit;
43
- border-top-width: 1px;
44
- }
45
- abbr:where([title]) {
46
- -webkit-text-decoration: underline dotted;
47
- text-decoration: underline dotted;
48
- }
49
- h1, h2, h3, h4, h5, h6 {
50
- font-size: inherit;
51
- font-weight: inherit;
52
- }
53
- a {
54
- color: inherit;
55
- -webkit-text-decoration: inherit;
56
- text-decoration: inherit;
57
- }
58
- b, strong {
59
- font-weight: bolder;
60
- }
61
- code, kbd, samp, pre {
62
- font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace), Fira Code, Fira Mono, Courier New, monospace;
63
- font-feature-settings: normal;
64
- font-variation-settings: normal;
65
- font-size: 1em;
66
- }
67
- small {
68
- font-size: 80%;
69
- }
70
- sub, sup {
71
- font-size: 75%;
72
- line-height: 0;
73
- position: relative;
74
- vertical-align: baseline;
75
- }
76
- sub {
77
- bottom: -0.25em;
78
- }
79
- sup {
80
- top: -0.5em;
81
- }
82
- table {
83
- text-indent: 0;
84
- border-color: inherit;
85
- border-collapse: collapse;
86
- }
87
- :-moz-focusring {
88
- outline: auto;
89
- }
90
- progress {
91
- vertical-align: baseline;
92
- }
93
- summary {
94
- display: list-item;
95
- }
96
- ol, ul, menu {
97
- list-style: none;
98
- }
99
- img, svg, video, canvas, audio, iframe, embed, object {
100
- display: block;
101
- vertical-align: middle;
102
- }
103
- img, video {
104
- max-width: 100%;
105
- height: auto;
106
- }
107
- button, input, select, optgroup, textarea, ::file-selector-button {
108
- font: inherit;
109
- font-feature-settings: inherit;
110
- font-variation-settings: inherit;
111
- letter-spacing: inherit;
112
- color: inherit;
113
- border-radius: 0;
114
- background-color: transparent;
115
- opacity: 1;
116
- }
117
- :where(select:is([multiple], [size])) optgroup {
118
- font-weight: bolder;
119
- }
120
- :where(select:is([multiple], [size])) optgroup option {
121
- padding-inline-start: 20px;
122
- }
123
- ::file-selector-button {
124
- margin-inline-end: 4px;
125
- }
126
- ::placeholder {
127
- opacity: 1;
128
- }
129
- @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
130
- ::placeholder {
131
- color: currentcolor;
132
- @supports (color: color-mix(in lab, red, red)) {
133
- color: color-mix(in oklab, currentcolor 50%, transparent);
134
- }
135
- }
136
- }
137
- textarea {
138
- resize: vertical;
139
- }
140
- ::-webkit-search-decoration {
141
- -webkit-appearance: none;
142
- }
143
- ::-webkit-date-and-time-value {
144
- min-height: 1lh;
145
- text-align: inherit;
146
- }
147
- ::-webkit-datetime-edit {
148
- display: inline-flex;
149
- }
150
- ::-webkit-datetime-edit-fields-wrapper {
151
- padding: 0;
152
- }
153
- ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
154
- padding-block: 0;
155
- }
156
- ::-webkit-calendar-picker-indicator {
157
- line-height: 1;
158
- }
159
- :-moz-ui-invalid {
160
- box-shadow: none;
161
- }
162
- button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
163
- appearance: button;
164
- }
165
- ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
166
- height: auto;
167
- }
168
- [hidden]:where(:not([hidden="until-found"])) {
169
- display: none !important;
170
- }
171
- }
172
- @layer utilities {
173
- .tour\:absolute {
174
- position: absolute;
175
- }
176
- .tour\:relative {
177
- position: relative;
178
- }
179
- .tour\:top-2 {
180
- top: calc(var(--tour-spacing) * 2);
181
- }
182
- .tour\:right-2 {
183
- right: calc(var(--tour-spacing) * 2);
184
- }
185
- .tour\:z-10 {
186
- z-index: 10;
187
- }
188
- .tour\:mt-1 {
189
- margin-top: calc(var(--tour-spacing) * 1);
190
- }
191
- .tour\:mb-2 {
192
- margin-bottom: calc(var(--tour-spacing) * 2);
193
- }
194
- .tour\:mb-4 {
195
- margin-bottom: calc(var(--tour-spacing) * 4);
196
- }
197
- .tour\:flex {
198
- display: flex;
199
- }
200
- .tour\:h-0 {
201
- height: calc(var(--tour-spacing) * 0);
202
- }
203
- .tour\:h-2 {
204
- height: calc(var(--tour-spacing) * 2);
205
- }
206
- .tour\:h-4 {
207
- height: calc(var(--tour-spacing) * 4);
208
- }
209
- .tour\:h-5 {
210
- height: calc(var(--tour-spacing) * 5);
211
- }
212
- .tour\:w-0 {
213
- width: calc(var(--tour-spacing) * 0);
214
- }
215
- .tour\:w-2 {
216
- width: calc(var(--tour-spacing) * 2);
217
- }
218
- .tour\:w-4 {
219
- width: calc(var(--tour-spacing) * 4);
220
- }
221
- .tour\:w-5 {
222
- width: calc(var(--tour-spacing) * 5);
223
- }
224
- .tour\:w-6 {
225
- width: calc(var(--tour-spacing) * 6);
226
- }
227
- .tour\:w-full {
228
- width: 100%;
229
- }
230
- .tour\:max-w-sm {
231
- max-width: var(--tour-container-sm);
232
- }
233
- .tour\:items-center {
234
- align-items: center;
235
- }
236
- .tour\:justify-between {
237
- justify-content: space-between;
238
- }
239
- .tour\:justify-center {
240
- justify-content: center;
241
- }
242
- .tour\:gap-1 {
243
- gap: calc(var(--tour-spacing) * 1);
244
- }
245
- .tour\:gap-2 {
246
- gap: calc(var(--tour-spacing) * 2);
247
- }
248
- .tour\:rounded-full {
249
- border-radius: calc(infinity * 1px);
250
- }
251
- .tour\:rounded-lg {
252
- border-radius: var(--tour-radius-lg);
253
- }
254
- .tour\:border-8 {
255
- border-style: var(--tw-border-style);
256
- border-width: 8px;
257
- }
258
- .tour\:border-transparent {
259
- border-color: transparent;
260
- }
261
- .tour\:bg-brand-primary {
262
- background-color: var(--brand-primary);
263
- }
264
- .tour\:bg-gray-200 {
265
- background-color: var(--tour-color-gray-200);
266
- }
267
- .tour\:bg-gray-300 {
268
- background-color: var(--tour-color-gray-300);
269
- }
270
- .tour\:bg-white {
271
- background-color: var(--tour-color-white);
272
- }
273
- .tour\:p-1 {
274
- padding: calc(var(--tour-spacing) * 1);
275
- }
276
- .tour\:p-6 {
277
- padding: calc(var(--tour-spacing) * 6);
278
- }
279
- .tour\:pr-6 {
280
- padding-right: calc(var(--tour-spacing) * 6);
281
- }
282
- .tour\:text-center {
283
- text-align: center;
284
- }
285
- .tour\:text-lg {
286
- font-size: var(--tour-text-lg);
287
- line-height: var(--tw-leading, var(--tour-text-lg--line-height));
288
- }
289
- .tour\:text-xs {
290
- font-size: var(--tour-text-xs);
291
- line-height: var(--tw-leading, var(--tour-text-xs--line-height));
292
- }
293
- .tour\:font-semibold {
294
- --tw-font-weight: var(--tour-font-weight-semibold);
295
- font-weight: var(--tour-font-weight-semibold);
296
- }
297
- .tour\:text-gray-500 {
298
- color: var(--tour-color-gray-500);
299
- }
300
- .tour\:text-gray-700 {
301
- color: var(--tour-color-gray-700);
302
- }
303
- .tour\:text-gray-900 {
304
- color: var(--tour-color-gray-900);
305
- }
306
- .tour\:shadow-xl {
307
- --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
308
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
309
- }
310
- .tour\:transition-all {
311
- transition-property: all;
312
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
313
- transition-duration: var(--tw-duration, var(--default-transition-duration));
314
- }
315
- .tour\:transition-colors {
316
- transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
317
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
318
- transition-duration: var(--tw-duration, var(--default-transition-duration));
319
- }
320
- .tour\:duration-300 {
321
- --tw-duration: 300ms;
322
- transition-duration: 300ms;
323
- }
324
- .tour\:hover\:bg-gray-100 {
325
- &:hover {
326
- @media (hover: hover) {
327
- background-color: var(--tour-color-gray-100);
328
- }
329
- }
330
- }
331
- .tour\:hover\:bg-gray-400 {
332
- &:hover {
333
- @media (hover: hover) {
334
- background-color: var(--tour-color-gray-400);
335
- }
336
- }
337
- }
338
- }
339
- @layer base {
340
- :root, [data-theme] {
341
- color: hsl(var(--heroui-foreground));
342
- background-color: hsl(var(--heroui-background));
343
- }
344
- }
345
- @layer base {
346
- :root, [data-theme=light] {
347
- color-scheme: light;
348
- --heroui-background: 0 0% 100%;
349
- --heroui-foreground-50: 0 0% 98.04%;
350
- --heroui-foreground-100: 240 4.76% 95.88%;
351
- --heroui-foreground-200: 240 5.88% 90%;
352
- --heroui-foreground-300: 240 4.88% 83.92%;
353
- --heroui-foreground-400: 240 5.03% 64.9%;
354
- --heroui-foreground-500: 240 3.83% 46.08%;
355
- --heroui-foreground-600: 240 5.2% 33.92%;
356
- --heroui-foreground-700: 240 5.26% 26.08%;
357
- --heroui-foreground-800: 240 3.7% 15.88%;
358
- --heroui-foreground-900: 240 5.88% 10%;
359
- --heroui-foreground: 201.81999999999994 24.44% 8.82%;
360
- --heroui-divider: 0 0% 6.67%;
361
- --heroui-focus: 212.01999999999998 100% 46.67%;
362
- --heroui-overlay: 0 0% 0%;
363
- --heroui-content1: 0 0% 100%;
364
- --heroui-content1-foreground: 201.81999999999994 24.44% 8.82%;
365
- --heroui-content2: 240 4.76% 95.88%;
366
- --heroui-content2-foreground: 240 3.7% 15.88%;
367
- --heroui-content3: 240 5.88% 90%;
368
- --heroui-content3-foreground: 240 5.26% 26.08%;
369
- --heroui-content4: 240 4.88% 83.92%;
370
- --heroui-content4-foreground: 240 5.2% 33.92%;
371
- --heroui-default-50: 0 0% 98.04%;
372
- --heroui-default-100: 240 4.76% 95.88%;
373
- --heroui-default-200: 240 5.88% 90%;
374
- --heroui-default-300: 240 4.88% 83.92%;
375
- --heroui-default-400: 240 5.03% 64.9%;
376
- --heroui-default-500: 240 3.83% 46.08%;
377
- --heroui-default-600: 240 5.2% 33.92%;
378
- --heroui-default-700: 240 5.26% 26.08%;
379
- --heroui-default-800: 240 3.7% 15.88%;
380
- --heroui-default-900: 240 5.88% 10%;
381
- --heroui-default-foreground: 0 0% 0%;
382
- --heroui-default: 240 4.88% 83.92%;
383
- --heroui-primary-50: 212.5 92.31% 94.9%;
384
- --heroui-primary-100: 211.84000000000003 92.45% 89.61%;
385
- --heroui-primary-200: 211.84000000000003 92.45% 79.22%;
386
- --heroui-primary-300: 212.24 92.45% 68.82%;
387
- --heroui-primary-400: 212.14 92.45% 58.43%;
388
- --heroui-primary-500: 212.01999999999998 100% 46.67%;
389
- --heroui-primary-600: 212.14 100% 38.43%;
390
- --heroui-primary-700: 212.24 100% 28.82%;
391
- --heroui-primary-800: 211.84000000000003 100% 19.22%;
392
- --heroui-primary-900: 211.84000000000003 100% 9.61%;
393
- --heroui-primary-foreground: 0 0% 100%;
394
- --heroui-primary: 212.01999999999998 100% 46.67%;
395
- --heroui-secondary-50: 270 61.54% 94.9%;
396
- --heroui-secondary-100: 270 59.26% 89.41%;
397
- --heroui-secondary-200: 270 59.26% 78.82%;
398
- --heroui-secondary-300: 270 59.26% 68.24%;
399
- --heroui-secondary-400: 270 59.26% 57.65%;
400
- --heroui-secondary-500: 270 66.67% 47.06%;
401
- --heroui-secondary-600: 270 66.67% 37.65%;
402
- --heroui-secondary-700: 270 66.67% 28.24%;
403
- --heroui-secondary-800: 270 66.67% 18.82%;
404
- --heroui-secondary-900: 270 66.67% 9.41%;
405
- --heroui-secondary-foreground: 0 0% 100%;
406
- --heroui-secondary: 270 66.67% 47.06%;
407
- --heroui-success-50: 146.66999999999996 64.29% 94.51%;
408
- --heroui-success-100: 145.71000000000004 61.4% 88.82%;
409
- --heroui-success-200: 146.2 61.74% 77.45%;
410
- --heroui-success-300: 145.78999999999996 62.57% 66.47%;
411
- --heroui-success-400: 146.01 62.45% 55.1%;
412
- --heroui-success-500: 145.96000000000004 79.46% 43.92%;
413
- --heroui-success-600: 146.01 79.89% 35.1%;
414
- --heroui-success-700: 145.78999999999996 79.26% 26.47%;
415
- --heroui-success-800: 146.2 79.78% 17.45%;
416
- --heroui-success-900: 145.71000000000004 77.78% 8.82%;
417
- --heroui-success-foreground: 0 0% 0%;
418
- --heroui-success: 145.96000000000004 79.46% 43.92%;
419
- --heroui-warning-50: 54.55000000000001 91.67% 95.29%;
420
- --heroui-warning-100: 37.139999999999986 91.3% 90.98%;
421
- --heroui-warning-200: 37.139999999999986 91.3% 81.96%;
422
- --heroui-warning-300: 36.95999999999998 91.24% 73.14%;
423
- --heroui-warning-400: 37.00999999999999 91.26% 64.12%;
424
- --heroui-warning-500: 37.02999999999997 91.27% 55.1%;
425
- --heroui-warning-600: 37.00999999999999 74.22% 44.12%;
426
- --heroui-warning-700: 36.95999999999998 73.96% 33.14%;
427
- --heroui-warning-800: 37.139999999999986 75% 21.96%;
428
- --heroui-warning-900: 37.139999999999986 75% 10.98%;
429
- --heroui-warning-foreground: 0 0% 0%;
430
- --heroui-warning: 37.02999999999997 91.27% 55.1%;
431
- --heroui-danger-50: 339.13 92% 95.1%;
432
- --heroui-danger-100: 340 91.84% 90.39%;
433
- --heroui-danger-200: 339.3299999999999 90% 80.39%;
434
- --heroui-danger-300: 339.11 90.6% 70.78%;
435
- --heroui-danger-400: 339 90% 60.78%;
436
- --heroui-danger-500: 339.20000000000005 90.36% 51.18%;
437
- --heroui-danger-600: 339 86.54% 40.78%;
438
- --heroui-danger-700: 339.11 85.99% 30.78%;
439
- --heroui-danger-800: 339.3299999999999 86.54% 20.39%;
440
- --heroui-danger-900: 340 84.91% 10.39%;
441
- --heroui-danger-foreground: 0 0% 100%;
442
- --heroui-danger: 339.20000000000005 90.36% 51.18%;
443
- --heroui-divider-weight: 1px;
444
- --heroui-disabled-opacity: .5;
445
- --heroui-font-size-tiny: 0.75rem;
446
- --heroui-font-size-small: 0.875rem;
447
- --heroui-font-size-medium: 1rem;
448
- --heroui-font-size-large: 1.125rem;
449
- --heroui-line-height-tiny: 1rem;
450
- --heroui-line-height-small: 1.25rem;
451
- --heroui-line-height-medium: 1.5rem;
452
- --heroui-line-height-large: 1.75rem;
453
- --heroui-radius-small: 8px;
454
- --heroui-radius-medium: 12px;
455
- --heroui-radius-large: 14px;
456
- --heroui-border-width-small: 1px;
457
- --heroui-border-width-medium: 2px;
458
- --heroui-border-width-large: 3px;
459
- --heroui-box-shadow-small: 0px 0px 5px 0px rgb(0 0 0 / 0.02), 0px 2px 10px 0px rgb(0 0 0 / 0.06), 0px 0px 1px 0px rgb(0 0 0 / 0.3);
460
- --heroui-box-shadow-medium: 0px 0px 15px 0px rgb(0 0 0 / 0.03), 0px 2px 30px 0px rgb(0 0 0 / 0.08), 0px 0px 1px 0px rgb(0 0 0 / 0.3);
461
- --heroui-box-shadow-large: 0px 0px 30px 0px rgb(0 0 0 / 0.04), 0px 30px 60px 0px rgb(0 0 0 / 0.12), 0px 0px 1px 0px rgb(0 0 0 / 0.3);
462
- --heroui-hover-opacity: .8;
463
- }
464
- }
465
- @property --tw-border-style {
466
- syntax: "*";
467
- inherits: false;
468
- initial-value: solid;
469
- }
470
- @property --tw-font-weight {
471
- syntax: "*";
472
- inherits: false;
473
- }
474
- @property --tw-shadow {
475
- syntax: "*";
476
- inherits: false;
477
- initial-value: 0 0 #0000;
478
- }
479
- @property --tw-shadow-color {
480
- syntax: "*";
481
- inherits: false;
482
- }
483
- @property --tw-shadow-alpha {
484
- syntax: "<percentage>";
485
- inherits: false;
486
- initial-value: 100%;
487
- }
488
- @property --tw-inset-shadow {
489
- syntax: "*";
490
- inherits: false;
491
- initial-value: 0 0 #0000;
492
- }
493
- @property --tw-inset-shadow-color {
494
- syntax: "*";
495
- inherits: false;
496
- }
497
- @property --tw-inset-shadow-alpha {
498
- syntax: "<percentage>";
499
- inherits: false;
500
- initial-value: 100%;
501
- }
502
- @property --tw-ring-color {
503
- syntax: "*";
504
- inherits: false;
505
- }
506
- @property --tw-ring-shadow {
507
- syntax: "*";
508
- inherits: false;
509
- initial-value: 0 0 #0000;
510
- }
511
- @property --tw-inset-ring-color {
512
- syntax: "*";
513
- inherits: false;
514
- }
515
- @property --tw-inset-ring-shadow {
516
- syntax: "*";
517
- inherits: false;
518
- initial-value: 0 0 #0000;
519
- }
520
- @property --tw-ring-inset {
521
- syntax: "*";
522
- inherits: false;
523
- }
524
- @property --tw-ring-offset-width {
525
- syntax: "<length>";
526
- inherits: false;
527
- initial-value: 0px;
528
- }
529
- @property --tw-ring-offset-color {
530
- syntax: "*";
531
- inherits: false;
532
- initial-value: #fff;
533
- }
534
- @property --tw-ring-offset-shadow {
535
- syntax: "*";
536
- inherits: false;
537
- initial-value: 0 0 #0000;
538
- }
539
- @property --tw-duration {
540
- syntax: "*";
541
- inherits: false;
542
- }
543
- @layer properties {
544
- @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
545
- *, ::before, ::after, ::backdrop {
546
- --tw-border-style: solid;
547
- --tw-font-weight: initial;
548
- --tw-shadow: 0 0 #0000;
549
- --tw-shadow-color: initial;
550
- --tw-shadow-alpha: 100%;
551
- --tw-inset-shadow: 0 0 #0000;
552
- --tw-inset-shadow-color: initial;
553
- --tw-inset-shadow-alpha: 100%;
554
- --tw-ring-color: initial;
555
- --tw-ring-shadow: 0 0 #0000;
556
- --tw-inset-ring-color: initial;
557
- --tw-inset-ring-shadow: 0 0 #0000;
558
- --tw-ring-inset: initial;
559
- --tw-ring-offset-width: 0px;
560
- --tw-ring-offset-color: #fff;
561
- --tw-ring-offset-shadow: 0 0 #0000;
562
- --tw-duration: initial;
563
- }
564
- }
565
- }
566
-