@geajs/ui 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/accordion.mjs +12 -12
  2. package/dist/accordion.mjs.map +1 -1
  3. package/dist/alert.mjs +44 -23
  4. package/dist/alert.mjs.map +1 -1
  5. package/dist/avatar.mjs +11 -11
  6. package/dist/avatar.mjs.map +1 -1
  7. package/dist/badge.mjs +19 -12
  8. package/dist/badge.mjs.map +1 -1
  9. package/dist/button.mjs +33 -23
  10. package/dist/button.mjs.map +1 -1
  11. package/dist/card.mjs +85 -43
  12. package/dist/card.mjs.map +1 -1
  13. package/dist/checkbox.mjs +5 -5
  14. package/dist/checkbox.mjs.map +1 -1
  15. package/dist/clipboard.mjs +10 -10
  16. package/dist/clipboard.mjs.map +1 -1
  17. package/dist/collapsible.mjs +18 -11
  18. package/dist/collapsible.mjs.map +1 -1
  19. package/dist/combobox.mjs +62 -48
  20. package/dist/combobox.mjs.map +1 -1
  21. package/dist/dialog.mjs +19 -12
  22. package/dist/dialog.mjs.map +1 -1
  23. package/dist/dnd-manager.mjs +18 -26
  24. package/dist/dnd-manager.mjs.map +1 -1
  25. package/dist/drag-drop-context.mjs +15 -8
  26. package/dist/drag-drop-context.mjs.map +1 -1
  27. package/dist/draggable.mjs +39 -19
  28. package/dist/draggable.mjs.map +1 -1
  29. package/dist/droppable.mjs +22 -12
  30. package/dist/droppable.mjs.map +1 -1
  31. package/dist/file-upload.mjs +24 -21
  32. package/dist/file-upload.mjs.map +1 -1
  33. package/dist/hover-card.mjs +27 -17
  34. package/dist/hover-card.mjs.map +1 -1
  35. package/dist/input.mjs +36 -24
  36. package/dist/input.mjs.map +1 -1
  37. package/dist/label.mjs +22 -12
  38. package/dist/label.mjs.map +1 -1
  39. package/dist/menu.mjs +9 -9
  40. package/dist/menu.mjs.map +1 -1
  41. package/dist/number-input.mjs +5 -5
  42. package/dist/number-input.mjs.map +1 -1
  43. package/dist/pagination.mjs +8 -9
  44. package/dist/pagination.mjs.map +1 -1
  45. package/dist/pin-input.mjs +11 -11
  46. package/dist/pin-input.mjs.map +1 -1
  47. package/dist/popover.mjs +19 -12
  48. package/dist/popover.mjs.map +1 -1
  49. package/dist/progress.mjs +8 -8
  50. package/dist/progress.mjs.map +1 -1
  51. package/dist/radio-group.mjs +16 -12
  52. package/dist/radio-group.mjs.map +1 -1
  53. package/dist/rating-group.mjs +21 -15
  54. package/dist/rating-group.mjs.map +1 -1
  55. package/dist/select.d.mts +1 -0
  56. package/dist/select.mjs +22 -17
  57. package/dist/select.mjs.map +1 -1
  58. package/dist/separator.mjs +12 -9
  59. package/dist/separator.mjs.map +1 -1
  60. package/dist/skeleton.mjs +6 -7
  61. package/dist/skeleton.mjs.map +1 -1
  62. package/dist/slider.mjs +5 -5
  63. package/dist/slider.mjs.map +1 -1
  64. package/dist/switch.mjs +5 -5
  65. package/dist/switch.mjs.map +1 -1
  66. package/dist/tabs.mjs +28 -20
  67. package/dist/tabs.mjs.map +1 -1
  68. package/dist/tags-input.mjs +18 -14
  69. package/dist/tags-input.mjs.map +1 -1
  70. package/dist/textarea.mjs +28 -19
  71. package/dist/textarea.mjs.map +1 -1
  72. package/dist/theme.css +198 -165
  73. package/dist/toast.mjs +6 -7
  74. package/dist/toast.mjs.map +1 -1
  75. package/dist/toggle-group.mjs +16 -12
  76. package/dist/toggle-group.mjs.map +1 -1
  77. package/dist/tooltip.mjs +18 -11
  78. package/dist/tooltip.mjs.map +1 -1
  79. package/dist/tree-view.mjs +17 -10
  80. package/dist/tree-view.mjs.map +1 -1
  81. package/dist/zag-component.mjs.map +1 -1
  82. package/package.json +1 -2
  83. package/dist/tailwind-preset.d.mts +0 -51
  84. package/dist/tailwind-preset.mjs +0 -50
  85. package/dist/tailwind-preset.mjs.map +0 -1
package/dist/textarea.mjs CHANGED
@@ -1,38 +1,41 @@
1
1
  import { t as cn } from "./cn.mjs";
2
- import { Component, GEA_CTOR_TAG_NAME, GEA_ELEMENT, geaEscapeHtml } from "@geajs/core";
2
+ import { Component, GEA_ELEMENT, GEA_ON_PROP_CHANGE, geaEscapeHtml } from "@geajs/core";
3
3
  //#region src/components/textarea.tsx
4
4
  var Textarea = class extends Component {
5
5
  static {
6
- this[GEA_CTOR_TAG_NAME] = "gea-textarea";
6
+ this.__geaTagName = "gea-textarea";
7
7
  }
8
8
  template(props) {
9
- return `<textarea id="${this.id}"${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null || cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) === false ? "" : ` class="${(cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) != null ? String(cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class)) : "").trim()}"`}${props.placeholder == null || props.placeholder === false ? "" : ` placeholder="${props.placeholder}"`}${props.disabled == null || props.disabled === false ? "" : ` disabled="${props.disabled}"`}${props.name == null || props.name === false ? "" : ` name="${props.name}"`}${props.rows == null || props.rows === false ? "" : ` rows="${props.rows}"`}>${geaEscapeHtml(String(props.value || ""))}</textarea>`;
9
+ return `<textarea id="${this.id}"${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null || cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) === false ? "" : ` class="${(cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) != null ? String(cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class)) : "").trim()}"`}${props.placeholder == null || props.placeholder === false ? "" : ` placeholder="${props.placeholder}"`}${props.disabled == null || props.disabled === false ? "" : ` disabled="${props.disabled}"`}${props.name == null || props.name === false ? "" : ` name="${props.name}"`}${props.rows == null || props.rows === false ? "" : ` rows="${props.rows}"`}>${geaEscapeHtml(String(props.value || ""))}</textarea>`;
10
10
  }
11
11
  get events() {
12
12
  if (this.__evts && this[GEA_ELEMENT]) return this.__evts;
13
- const __geaEvtsResult = { input: { [`#${this.id}`]: (e, targetComponent) => this.__event_input_0(e, targetComponent) } };
13
+ const __geaEvtsResult = { input: { [`#${this.id}`]: this.__event_input_0 } };
14
14
  if (this[GEA_ELEMENT]) this.__evts = __geaEvtsResult;
15
15
  return __geaEvtsResult;
16
16
  }
17
17
  __event_input_0(e, targetComponent) {
18
18
  this.props.onInput(e);
19
19
  }
20
- __onPropChange(key, value) {
20
+ [GEA_ON_PROP_CHANGE](key, value) {
21
21
  if (key === "class") {
22
22
  const __el = this[GEA_ELEMENT];
23
23
  this.props;
24
- const __boundValue = cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", value);
24
+ const __boundValue = cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", value);
25
25
  if (__el) {
26
- const __newClass = (__boundValue != null ? String(__boundValue) : "").trim();
26
+ const __newClass = String(__boundValue ?? "").trim().replace(/\s+/g, " ");
27
27
  if (__el.className !== __newClass) __el.className = __newClass;
28
28
  }
29
29
  }
30
30
  if (key === "placeholder") {
31
31
  const __el = this[GEA_ELEMENT];
32
- if (__el) if (value === null || value === void 0) __el.removeAttribute("placeholder");
33
- else {
34
- const __newAttr = String(value);
35
- if (__el.getAttribute("placeholder") !== __newAttr) __el.setAttribute("placeholder", __newAttr);
32
+ if (__el) {
33
+ var __av = value;
34
+ if (__av == null || __av === false) __el.removeAttribute("placeholder");
35
+ else {
36
+ const __newAttr = String(__av);
37
+ if (__el.getAttribute("placeholder") !== __newAttr) __el.setAttribute("placeholder", __newAttr);
38
+ }
36
39
  }
37
40
  }
38
41
  if (key === "disabled") {
@@ -45,18 +48,24 @@ var Textarea = class extends Component {
45
48
  }
46
49
  if (key === "name") {
47
50
  const __el = this[GEA_ELEMENT];
48
- if (__el) if (value === null || value === void 0) __el.removeAttribute("name");
49
- else {
50
- const __newAttr = String(value);
51
- if (__el.getAttribute("name") !== __newAttr) __el.setAttribute("name", __newAttr);
51
+ if (__el) {
52
+ var __av = value;
53
+ if (__av == null || __av === false) __el.removeAttribute("name");
54
+ else {
55
+ const __newAttr = String(__av);
56
+ if (__el.getAttribute("name") !== __newAttr) __el.setAttribute("name", __newAttr);
57
+ }
52
58
  }
53
59
  }
54
60
  if (key === "rows") {
55
61
  const __el = this[GEA_ELEMENT];
56
- if (__el) if (value === null || value === void 0) __el.removeAttribute("rows");
57
- else {
58
- const __newAttr = String(value);
59
- if (__el.getAttribute("rows") !== __newAttr) __el.setAttribute("rows", __newAttr);
62
+ if (__el) {
63
+ var __av = value;
64
+ if (__av == null || __av === false) __el.removeAttribute("rows");
65
+ else {
66
+ const __newAttr = String(__av);
67
+ if (__el.getAttribute("rows") !== __newAttr) __el.setAttribute("rows", __newAttr);
68
+ }
60
69
  }
61
70
  }
62
71
  if (key === "value") {
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.mjs","names":["Component","GEA_RENDERED","GEA_ELEMENT","GEA_MAPS","GEA_CONDS","GEA_RESET_ELS","GEA_OBSERVE","GEA_OBSERVE_LIST","GEA_EL","GEA_UPDATE_TEXT","GEA_REQUEST_RENDER","GEA_UPDATE_PROPS","GEA_SYNC_MAP","GEA_REGISTER_MAP","GEA_PATCH_COND","GEA_REGISTER_COND","GEA_REFRESH_LIST","GEA_RECONCILE_LIST","GEA_ENSURE_ARRAY_CONFIGS","GEA_APPLY_LIST_CHANGES","GEA_SWAP_CHILD","GEA_SWAP_STATE_CHILDREN","GEA_CHILD","GEA_LIST_CONFIG_REFRESHING","GEA_DOM_KEY","GEA_DOM_ITEM","GEA_DOM_PROPS","GEA_MAP_CONFIG_TPL","GEA_MAP_CONFIG_PREV","GEA_MAP_CONFIG_COUNT","geaCondPatchedSymbol","geaCondValueSymbol","geaObservePrevSymbol","geaPrevGuardSymbol","GEA_SETUP_LOCAL_STATE_OBSERVERS","geaSanitizeAttr","geaEscapeHtml","GEA_CTOR_TAG_NAME","cn","Textarea","template","props","__id","id","class","String","trim","placeholder","disabled","name","rows","value","events","__evts","__geaEvtsResult","input","e","targetComponent","__event_input_0","onInput","__onPropChange","key","__el","__boundValue","__newClass","className","undefined","removeAttribute","__newAttr","getAttribute","setAttribute","textContent"],"sources":["../src/components/textarea.tsx"],"sourcesContent":["import { Component } from '@geajs/core'\nimport { cn } from '../utils/cn'\n\nexport default class Textarea extends Component {\n template(props: any) {\n return (\n <textarea\n class={cn(\n 'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n props.class,\n )}\n placeholder={props.placeholder}\n disabled={props.disabled}\n name={props.name}\n rows={props.rows}\n onInput={props.onInput}\n >\n {props.value || ''}\n </textarea>\n )\n }\n}\n"],"mappings":";;;AAGA,IAAqBuC,WAArB,cAAsCvC,UAAU;;OAAAqC,qBAAA;;CAC9CG,SAASC,OAAY;AACnB,SAAA,iBADmB,KAAAE,GACnB,GAEWL,GACL,6QACAG,MAAMG,MACP,IAAA,QAHMN,GACL,6QACAG,MAAMG,MACP,KAAA,QAAA,KAAA,YAHMN,GACL,6QACAG,MAAMG,MACP,IAAA,OAAAC,OAHMP,GACL,6QACAG,MAAMG,MACP,CAAA,GAAA,IAAAE,MAAA,CAAA,KACYL,MAAMM,eAAW,QAAjBN,MAAMM,gBAAW,QAAA,KAAA,iBAAjBN,MAAMM,YAAW,KACpBN,MAAMO,YAAQ,QAAdP,MAAMO,aAAQ,QAAA,KAAA,cAAdP,MAAMO,SAAQ,KAClBP,MAAMQ,QAAI,QAAVR,MAAMQ,SAAI,QAAA,KAAA,UAAVR,MAAMQ,KAAI,KACVR,MAAMS,QAAI,QAAVT,MAAMS,SAAI,QAAA,KAAA,UAAVT,MAAMS,KAAI,GAAA,GAAAd,cAAAS,OAGfJ,MAAMU,SAAS,GAAE,CAAA,CAAA;;CAGvB,IAAAC,SAAA;AAAA,MAAA,KAAAC,UAAA,KAAAnD,aAAA,QAAA,KAAAmD;EAAA,MAAAC,kBAAA,EAAAC,OAAA,GAAA,IAAA,KAAAZ,QAAAa,GAAAC,oBAAA,KAAAC,gBAAAF,GAAAC,gBAAA,EAAA,EAAA;AAAA,MAAA,KAAAvD,aAAA,MAAAmD,SA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A,OAAA;QAAA;IAAA,MAAAC,YAAAvB,OAAAM,MAAA;AAAA,QAAAW,KAAAO,aAAA,OAAA,KAAAD,UAAAN,MAAAQ,aAAA,QAAAF,UAAA;;;AAAA,MAAAP,QAAA,SAAA;GAAA,MAAAC,OAAA,KAAA5D;AAJhQ,QAAAuC;GAAA,MAAAsB,eAAAZ,SAaG;AAAE,OAAAW,QAAAA,KAAAS,gBAAAR,aAAAD,MAAAS,cAAAR"}
1
+ {"version":3,"file":"textarea.mjs","names":["Component","geaEscapeHtml","GEA_ELEMENT","GEA_ON_PROP_CHANGE","cn","Textarea","__geaTagName","template","props","__id","id","class","String","trim","placeholder","disabled","name","rows","value","events","__evts","__geaEvtsResult","input","__event_input_0","e","targetComponent","onInput","key","__el","__boundValue","__newClass","replace","className","__av","removeAttribute","__newAttr","getAttribute","setAttribute","textContent"],"sources":["../src/components/textarea.tsx"],"sourcesContent":["import { Component } from '@geajs/core'\nimport { cn } from '../utils/cn'\n\nexport default class Textarea extends Component {\n template(props: any) {\n return (\n <textarea\n class={cn(\n 'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n props.class,\n )}\n placeholder={props.placeholder}\n disabled={props.disabled}\n name={props.name}\n rows={props.rows}\n onInput={props.onInput}\n >\n {props.value || ''}\n </textarea>\n )\n }\n}\n"],"mappings":";;;AAGA,IAAqBK,WAArB,cAAsCL,UAAU;;sBAAA;;CAC9CO,SAASC,OAAY;AACnB,SAAA,iBADmB,KAAAE,GACnB,GAEWN,GACL,+QACAI,MAAMG,MACP,IAAA,QAHMP,GACL,+QACAI,MAAMG,MACP,KAAA,QAAA,KAAA,YAHMP,GACL,+QACAI,MAAMG,MACP,IAAA,OAAAC,OAHMR,GACL,+QACAI,MAAMG,MACP,CAAA,GAAA,IAAAE,MAAA,CAAA,KACYL,M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;AAC/D,MAAAR,QAAA,YAAA;GAAA,MAAAC,OAAA,KAAA1B;AAAA,OAAA0B,KARP,KAAI,CAAAV,MACAU,MAAsBM,gBAAgB,WAAW;QAC5C;IACL,MAAMC,YAAY;AAClB,QAAIP,KAAsBQ,aAAa,WAAW,KAAKD,UACrDP,MAAsBS,aAAa,YAAYF,UAAU;;;AAC5D,MAAAR,QAAA,QAAA;GAAA,MAAAC,OAAA,KAAA1B;AAAA,OAAA0B,MAAA;IALG,IAAIK,OAAIf;AACR,QAAIe,QAAQ,QAAQA,SAAS,MAC3BL,MAAsBM,gBAAgB,OAAO;SACxC;KACL,MAAMC,YAAYvB,OAAOqB,KAAK;AAC9B,SAAIL,KAAsBQ,aAAa,OAAO,KAAKD,UACjDP,MAAsBS,aAAa,QAAQF,UAAU;;;;AACxD,MAAAR,QAAA,QAAA;GAAA,MAAAC,OAAA,KAAA1B;AAAA,OAAA0B,MAAA;IAPD,IAAIK,OAAIf;AACR,QAAIe,QAAQ,QAAQA,SAAS,MAC3BL,MAAsBM,gBAAgB,OAAO;SACxC;KACL,MAAMC,YAAYvB,OAAOqB,KAAK;AAC9B,SAAIL,KAAsBQ,aAAa,OAAO,KAAKD,UACjDP,MAAsBS,aAAa,QAAQF,UAAU;;;;AACxD,MAAAR,QAAA,SAAA;GAAA,MAAAC,OAAA,KAAA1B;AALc,QAAAM;GAAA,MAAAqB,eAaZX,SAAe;AAAE,OAAAU,QAhBtBA,KAAsBU,gBAAWT,aAArCD,MAAsBU,cAAWT"}
package/dist/theme.css CHANGED
@@ -1,52 +1,81 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import "tailwindcss";
2
+
3
+ @custom-variant dark (&:where(.dark, .dark *));
4
+
5
+ @theme inline {
6
+ --color-background: hsl(var(--background));
7
+ --color-foreground: hsl(var(--foreground));
8
+ --color-card: hsl(var(--card));
9
+ --color-card-foreground: hsl(var(--card-foreground));
10
+ --color-popover: hsl(var(--popover));
11
+ --color-popover-foreground: hsl(var(--popover-foreground));
12
+ --color-primary: hsl(var(--primary));
13
+ --color-primary-foreground: hsl(var(--primary-foreground));
14
+ --color-secondary: hsl(var(--secondary));
15
+ --color-secondary-foreground: hsl(var(--secondary-foreground));
16
+ --color-muted: hsl(var(--muted));
17
+ --color-muted-foreground: hsl(var(--muted-foreground));
18
+ --color-accent: hsl(var(--accent));
19
+ --color-accent-foreground: hsl(var(--accent-foreground));
20
+ --color-destructive: hsl(var(--destructive));
21
+ --color-destructive-foreground: hsl(var(--destructive-foreground));
22
+ --color-border: hsl(var(--border));
23
+ --color-input: hsl(var(--input));
24
+ --color-ring: hsl(var(--ring));
25
+ --radius-lg: var(--radius);
26
+ --radius-md: calc(var(--radius) - 2px);
27
+ --radius-sm: calc(var(--radius) - 4px);
28
+ --radius-xs: calc(var(--radius) - 6px);
29
+ }
4
30
 
5
- @layer base {
6
- :root {
7
- --background: 0 0% 100%;
8
- --foreground: 240 10% 3.9%;
9
- --card: 0 0% 100%;
10
- --card-foreground: 240 10% 3.9%;
11
- --popover: 0 0% 100%;
12
- --popover-foreground: 240 10% 3.9%;
13
- --primary: 240 5.9% 10%;
14
- --primary-foreground: 0 0% 98%;
15
- --secondary: 240 4.8% 95.9%;
16
- --secondary-foreground: 240 5.9% 10%;
17
- --muted: 240 4.8% 95.9%;
18
- --muted-foreground: 240 3.8% 46.1%;
19
- --accent: 240 4.8% 95.9%;
20
- --accent-foreground: 240 5.9% 10%;
21
- --destructive: 0 84.2% 60.2%;
22
- --destructive-foreground: 0 0% 98%;
23
- --border: 240 5.9% 90%;
24
- --input: 240 5.9% 90%;
25
- --ring: 240 5.9% 10%;
26
- --radius: 0.5rem;
27
- }
28
-
29
- .dark {
30
- --background: 240 10% 3.9%;
31
- --foreground: 0 0% 98%;
32
- --card: 240 10% 3.9%;
33
- --card-foreground: 0 0% 98%;
34
- --popover: 240 10% 3.9%;
35
- --popover-foreground: 0 0% 98%;
36
- --primary: 0 0% 98%;
37
- --primary-foreground: 240 5.9% 10%;
38
- --secondary: 240 3.7% 15.9%;
39
- --secondary-foreground: 0 0% 98%;
40
- --muted: 240 3.7% 15.9%;
41
- --muted-foreground: 240 5% 64.9%;
42
- --accent: 240 3.7% 15.9%;
43
- --accent-foreground: 0 0% 98%;
44
- --destructive: 0 62.8% 30.6%;
45
- --destructive-foreground: 0 0% 98%;
46
- --border: 240 3.7% 15.9%;
47
- --input: 240 3.7% 15.9%;
48
- --ring: 240 4.9% 83.9%;
49
- }
31
+ /* scan for compiled version of the components relative to the dist/ directory */
32
+ @source "./**/*.mjs";
33
+
34
+ :root {
35
+ --background: 0 0% 100%;
36
+ --foreground: 240 10% 3.9%;
37
+ --card: 0 0% 100%;
38
+ --card-foreground: 240 10% 3.9%;
39
+ --popover: 0 0% 100%;
40
+ --popover-foreground: 240 10% 3.9%;
41
+ --primary: 240 5.9% 10%;
42
+ --primary-foreground: 0 0% 98%;
43
+ --secondary: 240 4.8% 95.9%;
44
+ --secondary-foreground: 240 5.9% 10%;
45
+ --muted: 240 4.8% 95.9%;
46
+ --muted-foreground: 240 3.8% 46.1%;
47
+ --accent: 240 4.8% 95.9%;
48
+ --accent-foreground: 240 5.9% 10%;
49
+ --destructive: 0 84.2% 60.2%;
50
+ --destructive-foreground: 0 0% 98%;
51
+ --border: 240 5.9% 90%;
52
+ --input: 240 5.9% 90%;
53
+ --ring: 240 5.9% 10%;
54
+ --radius: 0.5rem;
55
+ --dialog-background: var(--background);
56
+ }
57
+
58
+ .dark {
59
+ --background: 240 10% 3.9%;
60
+ --foreground: 0 0% 98%;
61
+ --card: 240 10% 3.9%;
62
+ --card-foreground: 0 0% 98%;
63
+ --popover: 240 10% 3.9%;
64
+ --popover-foreground: 0 0% 98%;
65
+ --primary: 0 0% 98%;
66
+ --primary-foreground: 240 5.9% 10%;
67
+ --secondary: 240 3.7% 15.9%;
68
+ --secondary-foreground: 0 0% 98%;
69
+ --muted: 240 3.7% 15.9%;
70
+ --muted-foreground: 240 5% 64.9%;
71
+ --accent: 240 3.7% 15.9%;
72
+ --accent-foreground: 0 0% 98%;
73
+ --destructive: 0 62.8% 30.6%;
74
+ --destructive-foreground: 0 0% 98%;
75
+ --border: 240 3.7% 15.9%;
76
+ --input: 240 3.7% 15.9%;
77
+ --ring: 240 4.9% 83.9%;
78
+ --dialog-background: 344.35 7.21% 9.8%;
50
79
  }
51
80
 
52
81
  @layer base {
@@ -60,106 +89,83 @@
60
89
  }
61
90
  }
62
91
 
63
- /* Checkbox: hide indicator when unchecked, show on checked */
64
- .checkbox-control [data-part='indicator'] {
65
- display: none;
66
- }
67
- .checkbox-control[data-state='checked'] [data-part='indicator'] {
68
- display: flex;
69
- }
92
+ @layer components {
70
93
 
71
- /* Radio: dot hidden by default, visible when checked */
72
- .radio-dot {
73
- display: block;
74
- width: 0.625rem;
75
- height: 0.625rem;
76
- border-radius: 9999px;
77
- background: hsl(var(--primary));
78
- transform: scale(0);
79
- transition: transform 0.15s ease;
80
- }
81
- .radio-group-item-control[data-state='checked'] .radio-dot {
82
- transform: scale(1);
83
- }
94
+ /* Checkbox: hide indicator when unchecked, show on checked */
95
+ .checkbox-control [data-part='indicator'] {
96
+ display: none;
97
+ }
84
98
 
85
- /* Avatar: Zag uses hidden attribute to toggle image/fallback */
86
- .avatar-root [data-part='image'][hidden] {
87
- display: none;
88
- }
89
- .avatar-root [data-part='fallback'][hidden] {
90
- display: none;
91
- }
99
+ .checkbox-control[data-state='checked'] [data-part='indicator'] {
100
+ display: flex;
101
+ }
92
102
 
93
- /* Overlay components: hidden while the hidden attribute is present */
94
- .dialog-backdrop[hidden],
95
- .dialog-positioner[hidden],
96
- .dialog-content[hidden] {
97
- display: none;
98
- }
103
+ /* Radio: dot hidden by default, visible when checked */
104
+ .radio-dot {
105
+ display: block;
106
+ width: 0.625rem;
107
+ height: 0.625rem;
108
+ border-radius: 9999px;
109
+ background: hsl(var(--primary));
110
+ transform: scale(0);
111
+ transition: transform 0.15s ease;
112
+ }
99
113
 
100
- .dialog-backdrop {
101
- position: fixed;
102
- inset: 0;
103
- background: hsl(0 0% 0% / 0.5);
104
- z-index: 9998;
105
- }
114
+ .radio-group-item-control[data-state='checked'] .radio-dot {
115
+ transform: scale(1);
116
+ }
106
117
 
107
- .dialog-positioner {
108
- position: fixed;
109
- inset: 0;
110
- display: flex;
111
- align-items: center;
112
- justify-content: center;
113
- padding: 1rem;
114
- z-index: 9999;
115
- }
118
+ /* Avatar: Zag uses hidden attribute to toggle image/fallback */
119
+ .avatar-root [data-part='image'][hidden] {
120
+ display: none;
121
+ }
116
122
 
117
- .dialog-content {
118
- position: relative;
119
- width: min(100%, 28rem);
120
- max-height: calc(100vh - 2rem);
121
- overflow: auto;
122
- margin: 0 auto;
123
- padding: 1.5rem;
124
- border-radius: var(--radius);
125
- background: hsl(var(--background));
126
- color: hsl(var(--foreground));
127
- box-shadow:
128
- 0 20px 25px -5px hsl(240 10% 3.9% / 0.12),
129
- 0 8px 10px -6px hsl(240 10% 3.9% / 0.12);
130
- pointer-events: auto;
131
- }
123
+ .avatar-root [data-part='fallback'][hidden] {
124
+ display: none;
125
+ }
132
126
 
133
- /* Zag component animations */
134
- @layer utilities {
135
- [data-part='positioner'] > [data-part='content'][data-state='open'] {
136
- animation: fadeIn 150ms ease-out;
127
+ /* Overlay components: hidden while the hidden attribute is present */
128
+ .dialog-backdrop[hidden],
129
+ .dialog-positioner[hidden],
130
+ .dialog-content[hidden] {
131
+ display: none;
137
132
  }
138
133
 
139
- [data-part='positioner'] > [data-part='content'][data-state='closed'] {
140
- animation: fadeOut 100ms ease-in;
134
+ .dialog-backdrop {
135
+ position: fixed;
136
+ inset: 0;
137
+ z-index: 9998;
138
+ }
139
+
140
+ .dialog-positioner {
141
+ position: fixed;
142
+ inset: 0;
143
+ display: flex;
144
+ align-items: center;
145
+ justify-content: center;
146
+ padding: 1rem;
147
+ z-index: 9999;
141
148
  }
142
149
 
143
- @keyframes fadeIn {
144
- from {
145
- opacity: 0;
146
- transform: scale(0.95);
147
- }
148
- to {
149
- opacity: 1;
150
- transform: scale(1);
151
- }
150
+ .dialog-content {
151
+ position: relative;
152
+ width: min(100%, 28rem);
153
+ max-height: calc(100vh - 2rem);
154
+ overflow: auto;
155
+ margin: 0 auto;
156
+ padding: 1.5rem;
157
+ border-radius: var(--radius);
158
+ background: hsl(var(--dialog-background));
159
+ pointer-events: auto;
152
160
  }
153
161
 
154
- @keyframes fadeOut {
155
- from {
156
- opacity: 1;
157
- transform: scale(1);
158
- }
159
- to {
160
- opacity: 0;
161
- transform: scale(0.95);
162
- }
162
+ /* Zag component animations */
163
+ [data-part='positioner']>[data-part='content'][data-state='open'] {
164
+ animation: fadeIn 150ms ease-out;
165
+ }
166
+
167
+ [data-part='positioner']>[data-part='content'][data-state='closed'] {
168
+ animation: fadeOut 100ms ease-in;
163
169
  }
164
170
 
165
171
  /* Accordion open/close animation */
@@ -175,41 +181,68 @@
175
181
  transform: rotate(90deg);
176
182
  }
177
183
 
178
- @keyframes slideDown {
179
- from {
180
- height: 0;
181
- opacity: 0;
182
- }
183
- to {
184
- height: var(--height);
185
- opacity: 1;
186
- }
184
+ /* Toast slide-in animation */
185
+ .toast-root {
186
+ animation: toastSlideIn 200ms ease-out;
187
187
  }
188
+ }
188
189
 
189
- @keyframes slideUp {
190
- from {
191
- height: var(--height);
192
- opacity: 1;
193
- }
194
- to {
195
- height: 0;
196
- opacity: 0;
197
- }
190
+ @keyframes fadeIn {
191
+ from {
192
+ opacity: 0;
193
+ transform: scale(0.95);
198
194
  }
199
195
 
200
- /* Toast slide-in animation */
201
- .toast-root {
202
- animation: toastSlideIn 200ms ease-out;
196
+ to {
197
+ opacity: 1;
198
+ transform: scale(1);
199
+ }
200
+ }
201
+
202
+ @keyframes fadeOut {
203
+ from {
204
+ opacity: 1;
205
+ transform: scale(1);
206
+ }
207
+
208
+ to {
209
+ opacity: 0;
210
+ transform: scale(0.95);
211
+ }
212
+ }
213
+
214
+ @keyframes slideDown {
215
+ from {
216
+ height: 0;
217
+ opacity: 0;
203
218
  }
204
219
 
205
- @keyframes toastSlideIn {
206
- from {
207
- transform: translateX(100%);
208
- opacity: 0;
209
- }
210
- to {
211
- transform: translateX(0);
212
- opacity: 1;
213
- }
220
+ to {
221
+ height: var(--height);
222
+ opacity: 1;
214
223
  }
215
224
  }
225
+
226
+ @keyframes slideUp {
227
+ from {
228
+ height: var(--height);
229
+ opacity: 1;
230
+ }
231
+
232
+ to {
233
+ height: 0;
234
+ opacity: 0;
235
+ }
236
+ }
237
+
238
+ @keyframes toastSlideIn {
239
+ from {
240
+ transform: translateX(100%);
241
+ opacity: 0;
242
+ }
243
+
244
+ to {
245
+ transform: translateX(0);
246
+ opacity: 1;
247
+ }
248
+ }
package/dist/toast.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Component, GEA_CTOR_TAG_NAME, GEA_ELEMENT } from "@geajs/core";
1
+ import { Component, GEA_CLONE_TEMPLATE, GEA_ELEMENT, GEA_ON_PROP_CHANGE } from "@geajs/core";
2
2
  import { VanillaMachine, normalizeProps, spreadProps } from "@zag-js/vanilla";
3
3
  import * as toast from "@zag-js/toast";
4
4
  //#region src/components/toast.tsx
@@ -55,7 +55,7 @@ var ToastStore = class {
55
55
  };
56
56
  var Toaster = class extends Component {
57
57
  static {
58
- this[GEA_CTOR_TAG_NAME] = "toaster";
58
+ this.__geaTagName = "gea-toaster";
59
59
  }
60
60
  created(props) {
61
61
  this._toastMachines = /* @__PURE__ */ new Map();
@@ -186,22 +186,21 @@ var Toaster = class extends Component {
186
186
  return t;
187
187
  })();
188
188
  }
189
- __cloneTemplate() {
190
- const __id = this.id;
189
+ [GEA_CLONE_TEMPLATE]() {
191
190
  var __tpl = this.constructor.__tpl;
192
191
  if (!__tpl) throw new Error("[gea] __tpl missing for clone template");
193
192
  var __root = __tpl.content.firstElementChild.cloneNode(true);
194
- __root.id = __id;
193
+ __root.id = this.id;
195
194
  __root.className = `toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || "bottom-0 right-0"}`.trim();
196
195
  return __root;
197
196
  }
198
- __onPropChange(key, value) {
197
+ [GEA_ON_PROP_CHANGE](key, value) {
199
198
  if (key === "class") {
200
199
  const __el = this[GEA_ELEMENT];
201
200
  this.props;
202
201
  const __boundValue = `toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${value || "bottom-0 right-0"}`;
203
202
  if (__el) {
204
- const __newClass = (__boundValue != null ? String(__boundValue) : "").trim();
203
+ const __newClass = String(__boundValue ?? "").trim().replace(/\s+/g, " ");
205
204
  if (__el.className !== __newClass) __el.className = __newClass;
206
205
  }
207
206
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toast.mjs","names":["toast","VanillaMachine","normalizeProps","spreadProps","Component","GEA_RENDERED","GEA_ELEMENT","GEA_MAPS","GEA_CONDS","GEA_RESET_ELS","GEA_OBSERVE","GEA_OBSERVE_LIST","GEA_EL","GEA_UPDATE_TEXT","GEA_REQUEST_RENDER","GEA_UPDATE_PROPS","GEA_SYNC_MAP","GEA_REGISTER_MAP","GEA_PATCH_COND","GEA_REGISTER_COND","GEA_REFRESH_LIST","GEA_RECONCILE_LIST","GEA_ENSURE_ARRAY_CONFIGS","GEA_APPLY_LIST_CHANGES","GEA_SWAP_CHILD","GEA_SWAP_STATE_CHILDREN","GEA_CHILD","GEA_LIST_CONFIG_REFRESHING","GEA_DOM_KEY","GEA_DOM_ITEM","GEA_DOM_PROPS","GEA_MAP_CONFIG_TPL","GEA_MAP_CONFIG_PREV","GEA_MAP_CONFIG_COUNT","geaCondPatchedSymbol","geaCondValueSymbol","geaObservePrevSymbol","geaPrevGuardSymbol","GEA_SETUP_LOCAL_STATE_OBSERVERS","geaSanitizeAttr","geaEscapeHtml","GEA_CTOR_TAG_NAME","stripStyle","props","Record","style","_style","rest","_store","Store","getStore","StoreProps","createStore","placement","duration","removeDelay","max","ToastStore","create","options","Options","success","Omit","type","error","info","loading","dismiss","id","Toaster","_machine","_api","_toastMachines","Map","_spreadCleanups","Array","_currentToasts","created","store","storeProps","group","machine","start","connect","service","subscribe","nextToasts","getToasts","_syncToastDOM","_syncToastMachines","queueMicrotask","_applyGroupSpreads","_createToastElement","t","HTMLElement","div","document","createElement","setAttribute","className","inner","title","description","innerHTML","container","el","currentIds","Set","map","nextIds","has","querySelector","cleanups","get","forEach","fn","delete","remove","appendChild","stop","i","length","toastMachine","parent","index","stacked","set","rendered","groupEl","getGroupProps","toastEls","$$","toastId","dataset","api","prevCleanups","rootProps","getRootProps","push","getTitleProps","desc","getDescriptionProps","close","getCloseTriggerProps","action","getActionTriggerProps","onAfterRender","dispose","values","clear","template","__id","class","trim","__tpl","undefined","__cloneTemplate","constructor","Error","__root","content","firstElementChild","cloneNode","__onPropChange","key","value","__el","__boundValue","__newClass","String"],"sources":["../src/components/toast.tsx"],"sourcesContent":["import * as toast from '@zag-js/toast'\nimport { VanillaMachine, normalizeProps, spreadProps } from '@zag-js/vanilla'\nimport { Component } from '@geajs/core'\n\nfunction stripStyle(props: Record<string, any>): Record<string, any> {\n const { style: _style, ...rest } = props\n return rest\n}\n\nlet _store: toast.Store | null = null\n\nfunction getStore(props?: toast.StoreProps) {\n if (!_store) {\n _store = toast.createStore({\n placement: 'bottom-end',\n duration: 5000,\n removeDelay: 200,\n max: 5,\n ...props,\n })\n }\n return _store\n}\n\nexport class ToastStore {\n static getStore = getStore\n\n static create(options: toast.Options) {\n return getStore().create(options)\n }\n\n static success(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'success' })\n }\n\n static error(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'error' })\n }\n\n static info(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'info' })\n }\n\n static loading(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'loading' })\n }\n\n static dismiss(id?: string) {\n if (id) getStore().dismiss(id)\n else getStore().dismiss()\n }\n}\n\nexport class Toaster extends Component {\n declare _machine: VanillaMachine<any> | null\n declare _api: any\n declare _toastMachines: Map<string, VanillaMachine<any>>\n declare _spreadCleanups: Map<string, Array<() => void>>\n declare _currentToasts: toast.Options[]\n\n created(props: any) {\n this._toastMachines = new Map()\n this._spreadCleanups = new Map()\n this._currentToasts = []\n\n const store = getStore(props.storeProps)\n\n this._machine = new VanillaMachine(toast.group.machine, { store })\n this._machine.start()\n\n this._api = toast.group.connect(this._machine.service, normalizeProps)\n\n this._machine.subscribe(() => {\n if (!this._machine) return\n this._api = toast.group.connect(this._machine.service, normalizeProps)\n const nextToasts = this._api.getToasts()\n this._syncToastDOM(nextToasts)\n this._currentToasts = nextToasts\n this._syncToastMachines()\n queueMicrotask(() => this._applyGroupSpreads())\n })\n }\n\n _createToastElement(t: any): HTMLElement {\n const div = document.createElement('div')\n div.setAttribute('data-part', 'toast-root')\n div.setAttribute('data-toast-id', t.id)\n div.className =\n 'toast-root group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 shadow-lg transition-all bg-background text-foreground'\n\n let inner = '<div class=\"grid gap-1\">'\n if (t.title) inner += `<div data-part=\"title\" class=\"toast-title text-sm font-semibold\">${t.title}</div>`\n if (t.description)\n inner += `<div data-part=\"description\" class=\"toast-description text-sm opacity-90\">${t.description}</div>`\n inner += '</div>'\n inner +=\n '<button data-part=\"close-trigger\" class=\"toast-close-trigger text-foreground/50 hover:text-foreground\">&#x2715;</button>'\n div.innerHTML = inner\n return div\n }\n\n _syncToastDOM(nextToasts: any[]) {\n const container = this.el\n if (!container) return\n\n const currentIds = new Set(this._currentToasts.map((t: any) => t.id))\n const nextIds = new Set(nextToasts.map((t: any) => t.id))\n\n for (const id of currentIds) {\n if (!nextIds.has(id)) {\n const el = container.querySelector(`[data-toast-id=\"${id}\"]`)\n if (el) {\n const cleanups = this._spreadCleanups.get(id)\n if (cleanups) cleanups.forEach((fn) => fn())\n this._spreadCleanups.delete(id)\n el.remove()\n }\n }\n }\n\n for (const t of nextToasts) {\n if (!currentIds.has((t as any).id)) {\n const el = this._createToastElement(t as any)\n container.appendChild(el)\n }\n }\n }\n\n _syncToastMachines() {\n if (!this._machine) return\n const currentIds = new Set(this._currentToasts.map((t: any) => t.id))\n\n for (const [id, machine] of this._toastMachines) {\n if (!currentIds.has(id)) {\n machine.stop()\n this._toastMachines.delete(id)\n }\n }\n\n for (let i = 0; i < this._currentToasts.length; i++) {\n const t = this._currentToasts[i] as any\n if (!this._toastMachines.has(t.id)) {\n const toastMachine = new VanillaMachine(toast.machine, {\n ...t,\n parent: this._machine.service,\n index: i,\n stacked: true,\n removeDelay: t.removeDelay ?? 200,\n })\n toastMachine.start()\n this._toastMachines.set(t.id, toastMachine)\n\n toastMachine.subscribe(() => {\n queueMicrotask(() => this._applyGroupSpreads())\n })\n }\n }\n }\n\n _applyGroupSpreads() {\n if (!this.rendered || !this._api) return\n\n const groupEl = this.el\n if (groupEl) {\n spreadProps(groupEl, stripStyle(this._api.getGroupProps()))\n }\n\n const toastEls = this.$$('[data-toast-id]')\n for (const el of toastEls) {\n const toastId = (el as HTMLElement).dataset.toastId\n if (!toastId) continue\n\n const toastMachine = this._toastMachines.get(toastId)\n if (!toastMachine) continue\n\n const api = toast.connect(toastMachine.service, normalizeProps)\n\n const prevCleanups = this._spreadCleanups.get(toastId)\n if (prevCleanups) prevCleanups.forEach((fn) => fn())\n\n const cleanups: Array<() => void> = []\n const rootProps = stripStyle(api.getRootProps())\n delete rootProps['data-part']\n cleanups.push(spreadProps(el, rootProps))\n\n const title = el.querySelector('[data-part=\"title\"]')\n if (title) cleanups.push(spreadProps(title, api.getTitleProps()))\n\n const desc = el.querySelector('[data-part=\"description\"]')\n if (desc) cleanups.push(spreadProps(desc, api.getDescriptionProps()))\n\n const close = el.querySelector('[data-part=\"close-trigger\"]')\n if (close) cleanups.push(spreadProps(close, api.getCloseTriggerProps()))\n\n const action = el.querySelector('[data-part=\"action-trigger\"]')\n if (action) cleanups.push(spreadProps(action, api.getActionTriggerProps()))\n\n this._spreadCleanups.set(toastId, cleanups)\n }\n }\n\n onAfterRender() {\n this._applyGroupSpreads()\n }\n\n dispose() {\n for (const cleanups of this._spreadCleanups.values()) {\n cleanups.forEach((fn) => fn())\n }\n this._spreadCleanups.clear()\n\n for (const machine of this._toastMachines.values()) {\n machine.stop()\n }\n this._toastMachines.clear()\n\n if (this._machine) {\n this._machine.stop()\n this._machine = null\n }\n this._api = null\n\n super.dispose()\n }\n\n template(props: any) {\n return (\n <div\n data-part=\"group\"\n class={`toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || 'bottom-0 right-0'}`}\n />\n )\n }\n}\n"],"mappings":";;;;AAIA,SAAS0C,WAAWC,OAAiD;CACnE,MAAM,EAAEE,OAAOC,QAAQ,GAAGC,SAASJ;AACnC,QAAOI;;AAGT,IAAIC,SAA6B;AAEjC,SAASE,SAASP,OAA0B;AAC1C,KAAI,CAACK,OACHA,UAAShD,MAAMoD,YAAY;EACzBC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,KAAK;EACL,GAAGb;EACJ,CAAC;AAEJ,QAAOK;;AAGT,IAAaS,aAAb,MAAwB;;kBACJP;;CAElB,OAAOQ,OAAOC,SAAwB;AACpC,SAAOT,UAAU,CAACQ,OAAOC,QAAQ;;CAGnC,OAAOE,QAAQF,SAAsC;AACnD,SAAOT,UAAU,CAACQ,OAAO;GAAE,GAAGC;GAASI,MAAM;GAAW,CAAC;;CAG3D,OAAOC,MAAML,SAAsC;AACjD,SAAOT,UAAU,CAACQ,OAAO;GAAE,GAAGC;GAASI,MAAM;GAAS,CAAC;;CAGzD,OAAOE,KAAKN,SAAsC;AAChD,SAAOT,UAAU,CAACQ,OAAO;GAAE,GAAGC;GAASI,MAAM;GAAQ,CAAC;;CAGxD,OAAOG,QAAQP,SAAsC;AACnD,SAAOT,UAAU,CAACQ,OAAO;GAAE,GAAGC;GAASI,MAAM;GAAW,CAAC;;CAG3D,OAAOI,QAAQC,IAAa;AAC1B,MAAIA,GAAIlB,WAAU,CAAC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C,MAAA;IAAA,MAAAE,cAAAD,gBAAA,OAAAE,OAAAF,aAAA,GAAA,IAAAd,MAAA;AAAA,QAAAa,KAAAnE,cAAAqE,WAAAF,MAAAnE,YAAAqE"}
1
+ {"version":3,"file":"toast.mjs","names":["toast","VanillaMachine","normalizeProps","spreadProps","Component","GEA_CLONE_TEMPLATE","GEA_ON_PROP_CHANGE","GEA_ELEMENT","stripStyle","props","Record","style","_style","rest","_store","Store","getStore","StoreProps","createStore","placement","duration","removeDelay","max","ToastStore","create","options","Options","success","Omit","type","error","info","loading","dismiss","id","Toaster","__geaTagName","_machine","_api","_toastMachines","Map","_spreadCleanups","Array","_currentToasts","created","store","storeProps","group","machine","start","connect","service","subscribe","nextToasts","getToasts","_syncToastDOM","_syncToastMachines","queueMicrotask","_applyGroupSpreads","_createToastElement","t","HTMLElement","div","document","createElement","setAttribute","className","inner","title","description","innerHTML","container","el","currentIds","Set","map","nextIds","has","querySelector","cleanups","get","forEach","fn","delete","remove","appendChild","stop","i","length","toastMachine","parent","index","stacked","set","rendered","groupEl","getGroupProps","toastEls","$$","toastId","dataset","api","prevCleanups","rootProps","getRootProps","push","getTitleProps","desc","getDescriptionProps","close","getCloseTriggerProps","action","getActionTriggerProps","onAfterRender","dispose","values","clear","template","__id","class","trim","__tpl","undefined","constructor","Error","__root","content","firstElementChild","cloneNode","key","value","__el","__boundValue","__newClass","String","replace"],"sources":["../src/components/toast.tsx"],"sourcesContent":["import * as toast from '@zag-js/toast'\nimport { VanillaMachine, normalizeProps, spreadProps } from '@zag-js/vanilla'\nimport { Component } from '@geajs/core'\n\nfunction stripStyle(props: Record<string, any>): Record<string, any> {\n const { style: _style, ...rest } = props\n return rest\n}\n\nlet _store: toast.Store | null = null\n\nfunction getStore(props?: toast.StoreProps) {\n if (!_store) {\n _store = toast.createStore({\n placement: 'bottom-end',\n duration: 5000,\n removeDelay: 200,\n max: 5,\n ...props,\n })\n }\n return _store\n}\n\nexport class ToastStore {\n static getStore = getStore\n\n static create(options: toast.Options) {\n return getStore().create(options)\n }\n\n static success(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'success' })\n }\n\n static error(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'error' })\n }\n\n static info(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'info' })\n }\n\n static loading(options: Omit<toast.Options, 'type'>) {\n return getStore().create({ ...options, type: 'loading' })\n }\n\n static dismiss(id?: string) {\n if (id) getStore().dismiss(id)\n else getStore().dismiss()\n }\n}\n\nexport class Toaster extends Component {\n declare _machine: VanillaMachine<any> | null\n declare _api: any\n declare _toastMachines: Map<string, VanillaMachine<any>>\n declare _spreadCleanups: Map<string, Array<() => void>>\n declare _currentToasts: toast.Options[]\n\n created(props: any) {\n this._toastMachines = new Map()\n this._spreadCleanups = new Map()\n this._currentToasts = []\n\n const store = getStore(props.storeProps)\n\n this._machine = new VanillaMachine(toast.group.machine, { store })\n this._machine.start()\n\n this._api = toast.group.connect(this._machine.service, normalizeProps)\n\n this._machine.subscribe(() => {\n if (!this._machine) return\n this._api = toast.group.connect(this._machine.service, normalizeProps)\n const nextToasts = this._api.getToasts()\n this._syncToastDOM(nextToasts)\n this._currentToasts = nextToasts\n this._syncToastMachines()\n queueMicrotask(() => this._applyGroupSpreads())\n })\n }\n\n _createToastElement(t: any): HTMLElement {\n const div = document.createElement('div')\n div.setAttribute('data-part', 'toast-root')\n div.setAttribute('data-toast-id', t.id)\n div.className =\n 'toast-root group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 shadow-lg transition-all bg-background text-foreground'\n\n let inner = '<div class=\"grid gap-1\">'\n if (t.title) inner += `<div data-part=\"title\" class=\"toast-title text-sm font-semibold\">${t.title}</div>`\n if (t.description)\n inner += `<div data-part=\"description\" class=\"toast-description text-sm opacity-90\">${t.description}</div>`\n inner += '</div>'\n inner +=\n '<button data-part=\"close-trigger\" class=\"toast-close-trigger text-foreground/50 hover:text-foreground\">&#x2715;</button>'\n div.innerHTML = inner\n return div\n }\n\n _syncToastDOM(nextToasts: any[]) {\n const container = this.el\n if (!container) return\n\n const currentIds = new Set(this._currentToasts.map((t: any) => t.id))\n const nextIds = new Set(nextToasts.map((t: any) => t.id))\n\n for (const id of currentIds) {\n if (!nextIds.has(id)) {\n const el = container.querySelector(`[data-toast-id=\"${id}\"]`)\n if (el) {\n const cleanups = this._spreadCleanups.get(id)\n if (cleanups) cleanups.forEach((fn) => fn())\n this._spreadCleanups.delete(id)\n el.remove()\n }\n }\n }\n\n for (const t of nextToasts) {\n if (!currentIds.has((t as any).id)) {\n const el = this._createToastElement(t as any)\n container.appendChild(el)\n }\n }\n }\n\n _syncToastMachines() {\n if (!this._machine) return\n const currentIds = new Set(this._currentToasts.map((t: any) => t.id))\n\n for (const [id, machine] of this._toastMachines) {\n if (!currentIds.has(id)) {\n machine.stop()\n this._toastMachines.delete(id)\n }\n }\n\n for (let i = 0; i < this._currentToasts.length; i++) {\n const t = this._currentToasts[i] as any\n if (!this._toastMachines.has(t.id)) {\n const toastMachine = new VanillaMachine(toast.machine, {\n ...t,\n parent: this._machine.service,\n index: i,\n stacked: true,\n removeDelay: t.removeDelay ?? 200,\n })\n toastMachine.start()\n this._toastMachines.set(t.id, toastMachine)\n\n toastMachine.subscribe(() => {\n queueMicrotask(() => this._applyGroupSpreads())\n })\n }\n }\n }\n\n _applyGroupSpreads() {\n if (!this.rendered || !this._api) return\n\n const groupEl = this.el\n if (groupEl) {\n spreadProps(groupEl, stripStyle(this._api.getGroupProps()))\n }\n\n const toastEls = this.$$('[data-toast-id]')\n for (const el of toastEls) {\n const toastId = (el as HTMLElement).dataset.toastId\n if (!toastId) continue\n\n const toastMachine = this._toastMachines.get(toastId)\n if (!toastMachine) continue\n\n const api = toast.connect(toastMachine.service, normalizeProps)\n\n const prevCleanups = this._spreadCleanups.get(toastId)\n if (prevCleanups) prevCleanups.forEach((fn) => fn())\n\n const cleanups: Array<() => void> = []\n const rootProps = stripStyle(api.getRootProps())\n delete rootProps['data-part']\n cleanups.push(spreadProps(el, rootProps))\n\n const title = el.querySelector('[data-part=\"title\"]')\n if (title) cleanups.push(spreadProps(title, api.getTitleProps()))\n\n const desc = el.querySelector('[data-part=\"description\"]')\n if (desc) cleanups.push(spreadProps(desc, api.getDescriptionProps()))\n\n const close = el.querySelector('[data-part=\"close-trigger\"]')\n if (close) cleanups.push(spreadProps(close, api.getCloseTriggerProps()))\n\n const action = el.querySelector('[data-part=\"action-trigger\"]')\n if (action) cleanups.push(spreadProps(action, api.getActionTriggerProps()))\n\n this._spreadCleanups.set(toastId, cleanups)\n }\n }\n\n onAfterRender() {\n this._applyGroupSpreads()\n }\n\n dispose() {\n for (const cleanups of this._spreadCleanups.values()) {\n cleanups.forEach((fn) => fn())\n }\n this._spreadCleanups.clear()\n\n for (const machine of this._toastMachines.values()) {\n machine.stop()\n }\n this._toastMachines.clear()\n\n if (this._machine) {\n this._machine.stop()\n this._machine = null\n }\n this._api = null\n\n super.dispose()\n }\n\n template(props: any) {\n return (\n <div\n data-part=\"group\"\n class={`toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || 'bottom-0 right-0'}`}\n />\n )\n }\n}\n"],"mappings":";;;;AAIA,SAASQ,WAAWC,OAAiD;CACnE,MAAM,EAAEE,OAAOC,QAAQ,GAAGC,SAASJ;AACnC,QAAOI;;AAGT,IAAIC,SAA6B;AAEjC,SAASE,SAASP,OAA0B;AAC1C,KAAI,CAACK,OACHA,UAASd,MAAMkB,YAAY;EACzBC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,KAAK;EACL,GAAGb;EACJ,CAAC;AAEJ,QAAOK;;AAGT,IAAaS,aAAb,MAAwB;;kBACJP;;CAElB,OAAOQ,OAAOC,SAAwB;AACpC,SAAOT,UAAU,CAACQ,OAAOC,QAAQ;;CAGnC,OAAOE,QAAQF,SAAsC;AACnD,SAAOT,UAAU,CAACQ,OAAO;GAAE,GAAGC;GAAS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