@datatechsolutions/ui 3.14.0 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/astrlabe/index.js +108 -108
  2. package/dist/astrlabe/index.mjs +4 -4
  3. package/dist/astrlabe/workflow-canvas.js +4 -4
  4. package/dist/astrlabe/workflow-canvas.mjs +3 -3
  5. package/dist/{chunk-FHGWXWVZ.js → chunk-2JPS5OND.js} +45 -45
  6. package/dist/{chunk-FHGWXWVZ.js.map → chunk-2JPS5OND.js.map} +1 -1
  7. package/dist/{chunk-YFMMZHL5.js → chunk-2QZFKQP6.js} +26 -26
  8. package/dist/{chunk-YFMMZHL5.js.map → chunk-2QZFKQP6.js.map} +1 -1
  9. package/dist/{chunk-U7VMFQFN.mjs → chunk-3FOLXKVP.mjs} +4 -4
  10. package/dist/{chunk-U7VMFQFN.mjs.map → chunk-3FOLXKVP.mjs.map} +1 -1
  11. package/dist/{chunk-LJGPMMKB.js → chunk-435TRHC2.js} +72 -72
  12. package/dist/{chunk-LJGPMMKB.js.map → chunk-435TRHC2.js.map} +1 -1
  13. package/dist/{chunk-WE35EV7J.mjs → chunk-5QRU3KKV.mjs} +3 -3
  14. package/dist/{chunk-WE35EV7J.mjs.map → chunk-5QRU3KKV.mjs.map} +1 -1
  15. package/dist/{chunk-7SDB2VC2.js → chunk-6UUFPSAR.js} +4 -4
  16. package/dist/{chunk-7SDB2VC2.js.map → chunk-6UUFPSAR.js.map} +1 -1
  17. package/dist/{chunk-OTQXU4WG.mjs → chunk-7LIJTAIF.mjs} +8 -8
  18. package/dist/{chunk-OTQXU4WG.mjs.map → chunk-7LIJTAIF.mjs.map} +1 -1
  19. package/dist/{chunk-Q5TZTA6H.mjs → chunk-A5M7SPPG.mjs} +3 -3
  20. package/dist/{chunk-Q5TZTA6H.mjs.map → chunk-A5M7SPPG.mjs.map} +1 -1
  21. package/dist/{chunk-4HZ55YKZ.js → chunk-BN4BKFE2.js} +9 -9
  22. package/dist/{chunk-4HZ55YKZ.js.map → chunk-BN4BKFE2.js.map} +1 -1
  23. package/dist/{chunk-5SCZB5UI.js → chunk-C4UYEHPY.js} +84 -84
  24. package/dist/chunk-C4UYEHPY.js.map +1 -0
  25. package/dist/{chunk-AUCS2KF4.js → chunk-CPTHSYM2.js} +10 -10
  26. package/dist/{chunk-AUCS2KF4.js.map → chunk-CPTHSYM2.js.map} +1 -1
  27. package/dist/{chunk-PO66V2PN.mjs → chunk-EZVBRLQH.mjs} +3 -3
  28. package/dist/{chunk-PO66V2PN.mjs.map → chunk-EZVBRLQH.mjs.map} +1 -1
  29. package/dist/{chunk-T7DROKWJ.mjs → chunk-F3PQ5EFQ.mjs} +3 -3
  30. package/dist/{chunk-T7DROKWJ.mjs.map → chunk-F3PQ5EFQ.mjs.map} +1 -1
  31. package/dist/{chunk-ZE6U4N4Q.js → chunk-GD3YV46U.js} +36 -36
  32. package/dist/{chunk-ZE6U4N4Q.js.map → chunk-GD3YV46U.js.map} +1 -1
  33. package/dist/{chunk-5YCH7FHT.mjs → chunk-I6ULYJR4.mjs} +3 -3
  34. package/dist/{chunk-5YCH7FHT.mjs.map → chunk-I6ULYJR4.mjs.map} +1 -1
  35. package/dist/{chunk-Q2FUNDCP.mjs → chunk-JJUWZNJY.mjs} +3 -3
  36. package/dist/{chunk-Q2FUNDCP.mjs.map → chunk-JJUWZNJY.mjs.map} +1 -1
  37. package/dist/{chunk-ZIRD3X6G.js → chunk-KRS2CLPR.js} +139 -139
  38. package/dist/chunk-KRS2CLPR.js.map +1 -0
  39. package/dist/{chunk-FZUV7GNB.js → chunk-KZDABEML.js} +41 -41
  40. package/dist/{chunk-FZUV7GNB.js.map → chunk-KZDABEML.js.map} +1 -1
  41. package/dist/{chunk-33ZWFDVG.mjs → chunk-MSXJFWKD.mjs} +17 -17
  42. package/dist/chunk-MSXJFWKD.mjs.map +1 -0
  43. package/dist/{chunk-HQNIETHV.mjs → chunk-NNR44MM5.mjs} +7 -7
  44. package/dist/{chunk-HQNIETHV.mjs.map → chunk-NNR44MM5.mjs.map} +1 -1
  45. package/dist/{chunk-72XZ7DSF.js → chunk-NQCFGIWC.js} +13 -13
  46. package/dist/{chunk-72XZ7DSF.js.map → chunk-NQCFGIWC.js.map} +1 -1
  47. package/dist/{chunk-NIZSQJRW.js → chunk-OQM252SM.js} +30 -30
  48. package/dist/{chunk-NIZSQJRW.js.map → chunk-OQM252SM.js.map} +1 -1
  49. package/dist/{chunk-2II2NLAZ.js → chunk-PADXORD2.js} +34 -34
  50. package/dist/{chunk-2II2NLAZ.js.map → chunk-PADXORD2.js.map} +1 -1
  51. package/dist/{chunk-N6SGVUTR.mjs → chunk-PSS3E463.mjs} +3 -3
  52. package/dist/{chunk-N6SGVUTR.mjs.map → chunk-PSS3E463.mjs.map} +1 -1
  53. package/dist/{chunk-F4KHAKTP.mjs → chunk-QCGSE24W.mjs} +41 -41
  54. package/dist/{chunk-F4KHAKTP.mjs.map → chunk-QCGSE24W.mjs.map} +1 -1
  55. package/dist/{chunk-7NHJSD4A.mjs → chunk-RH6Z425K.mjs} +6 -6
  56. package/dist/{chunk-7NHJSD4A.mjs.map → chunk-RH6Z425K.mjs.map} +1 -1
  57. package/dist/{chunk-WTSMTLSP.mjs → chunk-SMUBE3RO.mjs} +11 -11
  58. package/dist/chunk-SMUBE3RO.mjs.map +1 -0
  59. package/dist/{chunk-PXGESUKI.js → chunk-WG26KW6D.js} +36 -36
  60. package/dist/{chunk-PXGESUKI.js.map → chunk-WG26KW6D.js.map} +1 -1
  61. package/dist/{chunk-NXWIT4YQ.mjs → chunk-WGS65S7S.mjs} +3 -3
  62. package/dist/{chunk-NXWIT4YQ.mjs.map → chunk-WGS65S7S.mjs.map} +1 -1
  63. package/dist/{chunk-4P72IJOM.js → chunk-XJJZ6DHE.js} +4 -4
  64. package/dist/{chunk-4P72IJOM.js.map → chunk-XJJZ6DHE.js.map} +1 -1
  65. package/dist/index.js +664 -664
  66. package/dist/index.mjs +2 -2
  67. package/dist/platform/admin/index.js +10 -10
  68. package/dist/platform/admin/index.mjs +4 -4
  69. package/dist/platform/agents-workspace.js +7 -7
  70. package/dist/platform/agents-workspace.mjs +6 -6
  71. package/dist/platform/app-shell.js +4 -4
  72. package/dist/platform/app-shell.mjs +3 -3
  73. package/dist/platform/auth/index.js +22 -22
  74. package/dist/platform/auth/index.mjs +4 -4
  75. package/dist/platform/billing/index.js +4 -4
  76. package/dist/platform/billing/index.mjs +3 -3
  77. package/dist/platform/impersonation/index.js +4 -4
  78. package/dist/platform/impersonation/index.mjs +3 -3
  79. package/dist/platform/index.js +78 -78
  80. package/dist/platform/index.mjs +18 -18
  81. package/dist/platform/pages/index.js +1503 -1622
  82. package/dist/platform/pages/index.js.map +1 -1
  83. package/dist/platform/pages/index.mjs +1219 -1338
  84. package/dist/platform/pages/index.mjs.map +1 -1
  85. package/dist/platform/settings/index.js +7 -7
  86. package/dist/platform/settings/index.mjs +6 -6
  87. package/dist/platform/workflow-canvas-shell.js +5 -5
  88. package/dist/platform/workflow-canvas-shell.mjs +4 -4
  89. package/package.json +1 -1
  90. package/dist/chunk-33ZWFDVG.mjs.map +0 -1
  91. package/dist/chunk-5SCZB5UI.js.map +0 -1
  92. package/dist/chunk-WTSMTLSP.mjs.map +0 -1
  93. package/dist/chunk-ZIRD3X6G.js.map +0 -1
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  import { adaptWorkflowGraphToUi, formatDurationMs } from '../../chunk-UQXVCVAN.mjs';
3
- import { WorkflowWorkspace } from '../../chunk-U7VMFQFN.mjs';
4
- export { RolesPageView, UsersPageView } from '../../chunk-U7VMFQFN.mjs';
5
- import { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-Q5TZTA6H.mjs';
6
- export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-Q5TZTA6H.mjs';
7
- import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-WTSMTLSP.mjs';
3
+ import { WorkflowWorkspace } from '../../chunk-3FOLXKVP.mjs';
4
+ export { RolesPageView, UsersPageView } from '../../chunk-3FOLXKVP.mjs';
5
+ import { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-A5M7SPPG.mjs';
6
+ export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-A5M7SPPG.mjs';
7
+ import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-SMUBE3RO.mjs';
8
8
  import '../../chunk-JB6RNAD2.mjs';
9
9
  import '../../chunk-LEXBTVGM.mjs';
10
- import '../../chunk-33ZWFDVG.mjs';
11
- import { HeroSection, SearchBar, FormSection, ChipPicker, PageLoadingState, PageEmptyState, EntityCard, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent, StepIndicator, FilterTileButton, PickerTile, FormToggle, Spinner, StatusBadge, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-F4KHAKTP.mjs';
10
+ import '../../chunk-MSXJFWKD.mjs';
11
+ import { HeroSection, SearchBar, FormSection, ChipPicker, PageLoadingState, PageEmptyState, EntityCard, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent, StepIndicator, Card, CardContent, FilterTileButton, PickerTile, FormToggle, Spinner, StatusBadge, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-QCGSE24W.mjs';
12
+ import '../../chunk-ZEFNBGYI.mjs';
12
13
  import '../../chunk-NBW6WJQT.mjs';
13
14
  import '../../chunk-3AY5HIQ6.mjs';
14
- import '../../chunk-ZEFNBGYI.mjs';
15
15
  import '../../chunk-KDDXDQR2.mjs';
16
- import { Button, Badge } from '../../chunk-2SBVFLPZ.mjs';
16
+ import { Button, Badge, IconButton } from '../../chunk-2SBVFLPZ.mjs';
17
17
  import '../../chunk-D2JF6C3E.mjs';
18
18
  import { useLink } from '../../chunk-QWG2FMUN.mjs';
19
19
  import '../../chunk-G7JQ4OCE.mjs';
20
20
  import { useState, useMemo, useEffect, useCallback } from 'react';
21
- import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, PencilSquareIcon, CodeBracketIcon, ServerStackIcon, SparklesIcon, BoltIcon, CloudIcon, BeakerIcon, GlobeAltIcon, BellAlertIcon, PencilIcon, ArrowUpCircleIcon } from '@heroicons/react/24/outline';
21
+ import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, XMarkIcon, CodeBracketIcon, ServerStackIcon, SparklesIcon, BoltIcon, CloudIcon, BeakerIcon, GlobeAltIcon, BellAlertIcon, PencilIcon, ArrowUpCircleIcon, PencilSquareIcon } from '@heroicons/react/24/outline';
22
22
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
23
23
 
24
24
  function AgentsModelsPageView({ labels, models, loading }) {
@@ -1786,20 +1786,20 @@ function DatasourcesPageView({
1786
1786
  title: ds.name ?? ds.id,
1787
1787
  subtitle: dialectLabel,
1788
1788
  status: /* @__PURE__ */ jsx(Badge, { color: ds.enabled ? "emerald" : "zinc", children: ds.enabled ? labels.enabled : labels.disabled }),
1789
- footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-400 dark:text-gray-500", children: [
1789
+ footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500", children: [
1790
1790
  ds.readOnly && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-semibold text-blue-700 dark:bg-blue-900/30 dark:text-blue-300", children: "Read-only" }),
1791
1791
  ds.timeoutMs && /* @__PURE__ */ jsxs("span", { children: [
1792
1792
  ds.timeoutMs / 1e3,
1793
1793
  "s timeout"
1794
1794
  ] })
1795
1795
  ] }),
1796
- children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-gray-500 dark:text-gray-400", children: [
1796
+ children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-slate-500 dark:text-slate-400", children: [
1797
1797
  /* @__PURE__ */ jsxs("div", { children: [
1798
1798
  labels.dialect,
1799
1799
  ": ",
1800
1800
  dialectLabel
1801
1801
  ] }),
1802
- ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-gray-400", children: [
1802
+ ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-slate-400", children: [
1803
1803
  "/",
1804
1804
  ds.slug
1805
1805
  ] })
@@ -3664,7 +3664,6 @@ function AgentNewWizardPageView({
3664
3664
  setSubmitting(false);
3665
3665
  }
3666
3666
  }
3667
- const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS));
3668
3667
  const hero = /* @__PURE__ */ jsx(
3669
3668
  HeroSection,
3670
3669
  {
@@ -3676,10 +3675,19 @@ function AgentNewWizardPageView({
3676
3675
  children: emoji
3677
3676
  }
3678
3677
  ),
3679
- label: counter,
3680
- title: labels.pageTitle,
3678
+ label: labels.pageTitle,
3679
+ title: stepTitles[step - 1],
3681
3680
  subtitle: stepSubtitles[step - 1],
3682
3681
  gradient: activePreset.accent,
3682
+ actions: /* @__PURE__ */ jsx(
3683
+ IconButton,
3684
+ {
3685
+ label: labels.wizardCancel,
3686
+ icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
3687
+ variant: "ghost",
3688
+ onClick: cancelWithConfirm
3689
+ }
3690
+ ),
3683
3691
  children: /* @__PURE__ */ jsx(
3684
3692
  StepIndicator,
3685
3693
  {
@@ -3694,459 +3702,369 @@ function AgentNewWizardPageView({
3694
3702
  );
3695
3703
  function renderStep1() {
3696
3704
  return /* @__PURE__ */ jsx(
3697
- SectionCard,
3698
- {
3699
- variant: "glass",
3700
- header: {
3701
- title: labels.presetTitle,
3702
- subtitle: labels.presetSubtitle
3703
- },
3704
- children: /* @__PURE__ */ jsx(
3705
- "div",
3706
- {
3707
- role: "radiogroup",
3708
- "aria-label": labels.presetTitle,
3709
- className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
3710
- children: AGENT_PRESETS.map((preset) => {
3711
- const selected = preset.id === presetId;
3712
- return /* @__PURE__ */ jsx(
3713
- FilterTileButton,
3714
- {
3715
- isActive: selected,
3716
- color: preset.tileColor,
3717
- icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
3718
- label: preset.id === "custom" ? labels.presetCustom : preset.name,
3719
- count: preset.role || labels.presetCustomHint,
3720
- onClick: () => applyPreset(preset)
3721
- },
3722
- preset.id
3723
- );
3724
- })
3725
- }
3726
- )
3727
- }
3728
- );
3729
- }
3730
- function renderStep2() {
3731
- return /* @__PURE__ */ jsx(
3732
- SectionCard,
3733
- {
3734
- variant: "glass",
3735
- header: {
3736
- title: labels.identitySection,
3737
- subtitle: labels.identitySubtitle
3738
- },
3739
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3740
- /* @__PURE__ */ jsxs("div", { children: [
3741
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.avatarLabel }),
3742
- /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: EMOJI_PALETTE.map((e) => /* @__PURE__ */ jsx(
3743
- PickerTile,
3744
- {
3745
- onClick: () => {
3746
- setEmoji(e);
3747
- markTouched();
3748
- },
3749
- selected: emoji === e,
3750
- className: [
3751
- "flex h-9 w-9 items-center justify-center rounded-lg text-base transition-all",
3752
- emoji === e ? `bg-gradient-to-br ${activePreset.accent} shadow-sm ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent` : "liquid-surface hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
3753
- ].join(" "),
3754
- children: e
3755
- },
3756
- e
3757
- )) })
3758
- ] }),
3759
- /* @__PURE__ */ jsxs(FormGrid, { children: [
3760
- /* @__PURE__ */ jsx(
3761
- FormInput,
3762
- {
3763
- label: labels.name,
3764
- value: name,
3765
- onValueChange: (v) => {
3766
- setName(v);
3767
- markTouched();
3768
- },
3769
- required: true,
3770
- placeholder: labels.namePlaceholder
3771
- }
3772
- ),
3773
- /* @__PURE__ */ jsx(
3774
- FormInput,
3775
- {
3776
- label: labels.role,
3777
- value: role,
3778
- onValueChange: (v) => {
3779
- setRole(v);
3780
- markTouched();
3781
- },
3782
- placeholder: labels.rolePlaceholder
3783
- }
3784
- )
3785
- ] }),
3786
- /* @__PURE__ */ jsx(
3787
- FormTextarea,
3788
- {
3789
- label: labels.descriptionLabel,
3790
- value: description,
3791
- onValueChange: (v) => {
3792
- setDescription(v);
3793
- markTouched();
3794
- },
3795
- rows: 3,
3796
- placeholder: labels.descriptionPlaceholder
3797
- }
3798
- )
3799
- ] })
3800
- }
3801
- );
3802
- }
3803
- function renderStep3() {
3804
- return /* @__PURE__ */ jsx(
3805
- SectionCard,
3705
+ "div",
3806
3706
  {
3807
- variant: "glass",
3808
- header: {
3809
- title: labels.modelSection,
3810
- subtitle: labels.connectionPickPrompt
3811
- },
3812
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3813
- /* @__PURE__ */ jsxs(FormGrid, { children: [
3814
- /* @__PURE__ */ jsx(
3815
- FormSelect,
3816
- {
3817
- label: labels.connectionLabel,
3818
- value: connectionId,
3819
- onValueChange: (v) => {
3820
- setConnectionId(v);
3821
- markTouched();
3822
- },
3823
- options: connectionOptions,
3824
- icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
3825
- }
3826
- ),
3827
- /* @__PURE__ */ jsx(
3828
- FormSelect,
3829
- {
3830
- label: labels.frameworkLabel,
3831
- value: framework,
3832
- onValueChange: (v) => {
3833
- setFramework(v);
3834
- markTouched();
3835
- },
3836
- options: frameworkOptions
3837
- }
3838
- ),
3839
- /* @__PURE__ */ jsx(
3840
- FormSelect,
3841
- {
3842
- label: labels.model,
3843
- value: modelId,
3844
- onValueChange: (v) => {
3845
- setModelId(v);
3846
- markTouched();
3847
- },
3848
- options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
3849
- }
3850
- )
3851
- ] }),
3852
- /* @__PURE__ */ jsx(
3853
- FormTextarea,
3707
+ role: "radiogroup",
3708
+ "aria-label": labels.presetTitle,
3709
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
3710
+ children: AGENT_PRESETS.map((preset) => {
3711
+ const selected = preset.id === presetId;
3712
+ return /* @__PURE__ */ jsx(
3713
+ FilterTileButton,
3854
3714
  {
3855
- label: labels.outputSchemaLabel,
3856
- value: outputSchema,
3857
- onValueChange: (v) => {
3858
- setOutputSchema(v);
3859
- markTouched();
3860
- },
3861
- rows: 5,
3862
- placeholder: labels.outputSchemaPlaceholder
3863
- }
3864
- )
3865
- ] })
3715
+ isActive: selected,
3716
+ color: preset.tileColor,
3717
+ icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
3718
+ label: preset.id === "custom" ? labels.presetCustom : preset.name,
3719
+ count: preset.role || labels.presetCustomHint,
3720
+ onClick: () => applyPreset(preset)
3721
+ },
3722
+ preset.id
3723
+ );
3724
+ })
3866
3725
  }
3867
3726
  );
3868
3727
  }
3869
- function renderStep4() {
3728
+ function renderStep2() {
3870
3729
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3730
+ /* @__PURE__ */ jsxs("div", { children: [
3731
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.avatarLabel }),
3732
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: EMOJI_PALETTE.map((e) => /* @__PURE__ */ jsx(
3733
+ PickerTile,
3734
+ {
3735
+ onClick: () => {
3736
+ setEmoji(e);
3737
+ markTouched();
3738
+ },
3739
+ selected: emoji === e,
3740
+ className: [
3741
+ "flex h-9 w-9 items-center justify-center rounded-lg text-base transition-all",
3742
+ emoji === e ? `bg-gradient-to-br ${activePreset.accent} shadow-sm ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent` : "liquid-surface hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
3743
+ ].join(" "),
3744
+ children: e
3745
+ },
3746
+ e
3747
+ )) })
3748
+ ] }),
3749
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
3750
+ /* @__PURE__ */ jsx(
3751
+ FormInput,
3752
+ {
3753
+ label: labels.name,
3754
+ value: name,
3755
+ onValueChange: (v) => {
3756
+ setName(v);
3757
+ markTouched();
3758
+ },
3759
+ required: true,
3760
+ placeholder: labels.namePlaceholder
3761
+ }
3762
+ ),
3763
+ /* @__PURE__ */ jsx(
3764
+ FormInput,
3765
+ {
3766
+ label: labels.role,
3767
+ value: role,
3768
+ onValueChange: (v) => {
3769
+ setRole(v);
3770
+ markTouched();
3771
+ },
3772
+ placeholder: labels.rolePlaceholder
3773
+ }
3774
+ )
3775
+ ] }),
3871
3776
  /* @__PURE__ */ jsx(
3872
- SectionCard,
3777
+ FormTextarea,
3873
3778
  {
3874
- variant: "glass",
3875
- header: {
3876
- title: labels.behaviorSection,
3877
- subtitle: labels.behaviorSubtitle
3779
+ label: labels.descriptionLabel,
3780
+ value: description,
3781
+ onValueChange: (v) => {
3782
+ setDescription(v);
3783
+ markTouched();
3878
3784
  },
3879
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3880
- /* @__PURE__ */ jsx(
3881
- FormTextarea,
3882
- {
3883
- label: labels.promptSystemPrompt,
3884
- value: systemPrompt,
3885
- onValueChange: (v) => {
3886
- setSystemPrompt(v);
3887
- markTouched();
3888
- },
3889
- rows: 8,
3890
- placeholder: labels.promptPlaceholder,
3891
- hint: `${systemPrompt.length} chars`
3892
- }
3893
- ),
3894
- /* @__PURE__ */ jsx(
3895
- FormTextarea,
3896
- {
3897
- label: labels.userPromptLabel,
3898
- value: userPrompt,
3899
- onValueChange: (v) => {
3900
- setUserPrompt(v);
3901
- markTouched();
3902
- },
3903
- rows: 5,
3904
- placeholder: labels.userPromptPlaceholder,
3905
- hint: `${userPrompt.length} chars`
3906
- }
3907
- ),
3908
- /* @__PURE__ */ jsx(
3909
- RangeSliderField,
3910
- {
3911
- sliderId: "wizard-temperature",
3912
- label: labels.temperature,
3913
- value: temperature,
3914
- onChange: (v) => {
3915
- setTemperature(v);
3916
- markTouched();
3917
- },
3918
- min: 0,
3919
- max: 1,
3920
- step: 0.05,
3921
- trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
3922
- formatValue: (v) => v.toFixed(2),
3923
- zones: [
3924
- { label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
3925
- { label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
3926
- { label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
3927
- ]
3928
- }
3929
- ),
3930
- /* @__PURE__ */ jsx(
3931
- RangeSliderField,
3932
- {
3933
- sliderId: "wizard-top-p",
3934
- label: labels.topPLabel,
3935
- value: topP,
3936
- onChange: (v) => {
3937
- setTopP(v);
3938
- markTouched();
3939
- },
3940
- min: 0,
3941
- max: 1,
3942
- step: 0.05,
3943
- trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
3944
- formatValue: (v) => v.toFixed(2),
3945
- zones: [
3946
- { label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
3947
- ]
3948
- }
3949
- ),
3950
- /* @__PURE__ */ jsx(
3951
- RangeSliderField,
3952
- {
3953
- sliderId: "wizard-top-k",
3954
- label: labels.topKLabel,
3955
- value: topK,
3956
- onChange: (v) => {
3957
- setTopK(Math.max(0, Math.floor(v)));
3958
- markTouched();
3959
- },
3960
- min: 0,
3961
- max: 500,
3962
- step: 1,
3963
- trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
3964
- formatValue: (v) => v.toString(),
3965
- zones: [
3966
- { label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
3967
- ]
3968
- }
3969
- ),
3970
- /* @__PURE__ */ jsx(
3971
- FormInput,
3972
- {
3973
- label: labels.maxTokens,
3974
- type: "number",
3975
- value: String(maxTokens),
3976
- onValueChange: (v) => {
3977
- setMaxTokens(Math.max(1, Math.floor(Number(v) || 0)));
3978
- markTouched();
3979
- },
3980
- min: 1,
3981
- max: 32e3,
3982
- step: 1,
3983
- hint: maxTokens.toLocaleString()
3984
- }
3985
- ),
3986
- /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200/30 dark:border-white/10", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-px bg-slate-200/30 dark:bg-white/10", children: [
3987
- /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
3988
- /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.model }),
3989
- /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-semibold text-slate-900 dark:text-white", children: matchingModels.find((m) => m.id === modelId)?.name ?? labels.modelEmpty })
3990
- ] }),
3991
- /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
3992
- /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.maxTokens }),
3993
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-900 dark:text-white", children: maxTokens.toLocaleString() })
3994
- ] }),
3995
- /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
3996
- /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.temperature }),
3997
- /* @__PURE__ */ jsxs("p", { className: `text-xs font-semibold ${temperature <= 0.3 ? "text-blue-500" : temperature <= 0.7 ? "text-purple-500" : "text-pink-500"}`, children: [
3998
- temperature.toFixed(2),
3999
- " \xB7 ",
4000
- temperature <= 0.3 ? "Precise" : temperature <= 0.7 ? "Balanced" : "Creative"
4001
- ] })
4002
- ] })
4003
- ] }) })
4004
- ] })
3785
+ rows: 3,
3786
+ placeholder: labels.descriptionPlaceholder
4005
3787
  }
4006
- ),
3788
+ )
3789
+ ] });
3790
+ }
3791
+ function renderStep3() {
3792
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3793
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
3794
+ /* @__PURE__ */ jsx(
3795
+ FormSelect,
3796
+ {
3797
+ label: labels.connectionLabel,
3798
+ value: connectionId,
3799
+ onValueChange: (v) => {
3800
+ setConnectionId(v);
3801
+ markTouched();
3802
+ },
3803
+ options: connectionOptions,
3804
+ icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
3805
+ }
3806
+ ),
3807
+ /* @__PURE__ */ jsx(
3808
+ FormSelect,
3809
+ {
3810
+ label: labels.frameworkLabel,
3811
+ value: framework,
3812
+ onValueChange: (v) => {
3813
+ setFramework(v);
3814
+ markTouched();
3815
+ },
3816
+ options: frameworkOptions
3817
+ }
3818
+ ),
3819
+ /* @__PURE__ */ jsx(
3820
+ FormSelect,
3821
+ {
3822
+ label: labels.model,
3823
+ value: modelId,
3824
+ onValueChange: (v) => {
3825
+ setModelId(v);
3826
+ markTouched();
3827
+ },
3828
+ options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
3829
+ }
3830
+ )
3831
+ ] }),
4007
3832
  /* @__PURE__ */ jsx(
4008
- SectionCard,
3833
+ FormTextarea,
4009
3834
  {
4010
- variant: "glass",
4011
- header: {
4012
- title: labels.metadataSection,
4013
- subtitle: labels.metadataSubtitle
3835
+ label: labels.outputSchemaLabel,
3836
+ value: outputSchema,
3837
+ onValueChange: (v) => {
3838
+ setOutputSchema(v);
3839
+ markTouched();
4014
3840
  },
4015
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4016
- /* @__PURE__ */ jsxs("div", { children: [
4017
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel }),
4018
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
4019
- const selected = difficulty === opt.id;
4020
- const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
4021
- return /* @__PURE__ */ jsxs(
4022
- PickerTile,
4023
- {
4024
- onClick: () => {
4025
- setDifficulty(opt.id);
4026
- markTouched();
4027
- },
4028
- selected,
4029
- className: [
4030
- "liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
4031
- selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
4032
- ].join(" "),
4033
- children: [
4034
- /* @__PURE__ */ jsx(
4035
- "span",
4036
- {
4037
- "aria-hidden": "true",
4038
- className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
4039
- children: opt.emoji
4040
- }
4041
- ),
4042
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
4043
- ]
4044
- },
4045
- opt.id
4046
- );
4047
- }) })
4048
- ] }),
4049
- /* @__PURE__ */ jsx(
4050
- FormInput,
4051
- {
4052
- label: labels.tagsLabel,
4053
- value: tagsInput,
4054
- onValueChange: (v) => {
4055
- setTagsInput(v);
4056
- markTouched();
4057
- },
4058
- placeholder: labels.tagsPlaceholder
4059
- }
4060
- )
4061
- ] })
3841
+ rows: 5,
3842
+ placeholder: labels.outputSchemaPlaceholder
4062
3843
  }
4063
3844
  )
4064
3845
  ] });
4065
3846
  }
4066
- function renderStep5() {
4067
- const modelLabel = models.find((m) => m.id === modelId)?.name ?? labels.modelEmpty;
4068
- const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
3847
+ function renderStep4() {
4069
3848
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4070
3849
  /* @__PURE__ */ jsx(
4071
- SectionCard,
3850
+ FormTextarea,
4072
3851
  {
4073
- variant: "glass",
4074
- header: {
4075
- title: labels.wizardStep1Title,
4076
- subtitle: labels.wizardStep1Subtitle
3852
+ label: labels.promptSystemPrompt,
3853
+ value: systemPrompt,
3854
+ onValueChange: (v) => {
3855
+ setSystemPrompt(v);
3856
+ markTouched();
4077
3857
  },
4078
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
4079
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4080
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4081
- ] }),
4082
- children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: presetId === "custom" ? labels.presetCustom : AGENT_PRESETS.find((p) => p.id === presetId)?.name ?? labels.presetCustom })
3858
+ rows: 6,
3859
+ placeholder: labels.promptPlaceholder,
3860
+ hint: `${systemPrompt.length} chars`
4083
3861
  }
4084
3862
  ),
4085
3863
  /* @__PURE__ */ jsx(
4086
- SectionCard,
3864
+ FormTextarea,
4087
3865
  {
4088
- variant: "glass",
4089
- header: {
4090
- title: labels.wizardStep2Title,
4091
- subtitle: labels.wizardStep2Subtitle
3866
+ label: labels.userPromptLabel,
3867
+ value: userPrompt,
3868
+ onValueChange: (v) => {
3869
+ setUserPrompt(v);
3870
+ markTouched();
4092
3871
  },
4093
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
4094
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4095
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4096
- ] }),
4097
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
4098
- /* @__PURE__ */ jsx(
4099
- "span",
4100
- {
4101
- "aria-hidden": "true",
4102
- className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${activePreset.accent} text-lg shadow-sm`,
4103
- children: emoji
4104
- }
4105
- ),
4106
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4107
- /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: name || labels.namePlaceholder }),
4108
- role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: role }),
4109
- description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-slate-600 dark:text-slate-300", children: description })
4110
- ] })
4111
- ] })
3872
+ rows: 4,
3873
+ placeholder: labels.userPromptPlaceholder,
3874
+ hint: `${userPrompt.length} chars`
4112
3875
  }
4113
3876
  ),
4114
3877
  /* @__PURE__ */ jsx(
4115
- SectionCard,
3878
+ RangeSliderField,
4116
3879
  {
4117
- variant: "glass",
4118
- header: {
4119
- title: labels.wizardStep3Title,
4120
- subtitle: labels.wizardStep3Subtitle
3880
+ sliderId: "wizard-temperature",
3881
+ label: labels.temperature,
3882
+ value: temperature,
3883
+ onChange: (v) => {
3884
+ setTemperature(v);
3885
+ markTouched();
4121
3886
  },
4122
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
4123
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4124
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4125
- ] }),
4126
- children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4127
- /* @__PURE__ */ jsx(ReviewRow, { label: labels.connectionLabel, value: connectionLabel }),
4128
- /* @__PURE__ */ jsx(ReviewRow, { label: labels.frameworkLabel, value: framework || "\u2014" }),
4129
- /* @__PURE__ */ jsx(ReviewRow, { label: labels.model, value: modelLabel }),
4130
- outputSchema.trim() && /* @__PURE__ */ jsx(ReviewRow, { label: labels.outputSchemaLabel, value: outputSchema.trim().slice(0, 60) + (outputSchema.length > 60 ? "\u2026" : "") })
4131
- ] })
3887
+ min: 0,
3888
+ max: 1,
3889
+ step: 0.05,
3890
+ trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
3891
+ formatValue: (v) => v.toFixed(2),
3892
+ zones: [
3893
+ { label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
3894
+ { label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
3895
+ { label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
3896
+ ]
4132
3897
  }
4133
3898
  ),
4134
- /* @__PURE__ */ jsxs(
4135
- SectionCard,
3899
+ /* @__PURE__ */ jsx(
3900
+ RangeSliderField,
4136
3901
  {
4137
- variant: "glass",
4138
- header: {
4139
- title: labels.wizardStep4Title,
4140
- subtitle: labels.wizardStep4Subtitle
3902
+ sliderId: "wizard-top-p",
3903
+ label: labels.topPLabel,
3904
+ value: topP,
3905
+ onChange: (v) => {
3906
+ setTopP(v);
3907
+ markTouched();
4141
3908
  },
4142
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
4143
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4144
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4145
- ] }),
4146
- children: [
4147
- /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: [
4148
- /* @__PURE__ */ jsx(ReviewRow, { label: labels.temperature, value: temperature.toFixed(2) }),
4149
- /* @__PURE__ */ jsx(ReviewRow, { label: labels.topPLabel, value: topP.toFixed(2) }),
3909
+ min: 0,
3910
+ max: 1,
3911
+ step: 0.05,
3912
+ trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
3913
+ formatValue: (v) => v.toFixed(2),
3914
+ zones: [
3915
+ { label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
3916
+ ]
3917
+ }
3918
+ ),
3919
+ /* @__PURE__ */ jsx(
3920
+ RangeSliderField,
3921
+ {
3922
+ sliderId: "wizard-top-k",
3923
+ label: labels.topKLabel,
3924
+ value: topK,
3925
+ onChange: (v) => {
3926
+ setTopK(Math.max(0, Math.floor(v)));
3927
+ markTouched();
3928
+ },
3929
+ min: 0,
3930
+ max: 500,
3931
+ step: 1,
3932
+ trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
3933
+ formatValue: (v) => v.toString(),
3934
+ zones: [
3935
+ { label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
3936
+ ]
3937
+ }
3938
+ ),
3939
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
3940
+ /* @__PURE__ */ jsx(
3941
+ FormInput,
3942
+ {
3943
+ label: labels.maxTokens,
3944
+ type: "number",
3945
+ value: String(maxTokens),
3946
+ onValueChange: (v) => {
3947
+ setMaxTokens(Math.max(1, Math.floor(Number(v) || 0)));
3948
+ markTouched();
3949
+ },
3950
+ min: 1,
3951
+ max: 32e3,
3952
+ step: 1,
3953
+ hint: maxTokens.toLocaleString()
3954
+ }
3955
+ ),
3956
+ /* @__PURE__ */ jsx(
3957
+ FormInput,
3958
+ {
3959
+ label: labels.tagsLabel,
3960
+ value: tagsInput,
3961
+ onValueChange: (v) => {
3962
+ setTagsInput(v);
3963
+ markTouched();
3964
+ },
3965
+ placeholder: labels.tagsPlaceholder
3966
+ }
3967
+ )
3968
+ ] }),
3969
+ /* @__PURE__ */ jsxs("div", { children: [
3970
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel }),
3971
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
3972
+ const selected = difficulty === opt.id;
3973
+ const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
3974
+ return /* @__PURE__ */ jsxs(
3975
+ PickerTile,
3976
+ {
3977
+ onClick: () => {
3978
+ setDifficulty(opt.id);
3979
+ markTouched();
3980
+ },
3981
+ selected,
3982
+ className: [
3983
+ "liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
3984
+ selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
3985
+ ].join(" "),
3986
+ children: [
3987
+ /* @__PURE__ */ jsx(
3988
+ "span",
3989
+ {
3990
+ "aria-hidden": "true",
3991
+ className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
3992
+ children: opt.emoji
3993
+ }
3994
+ ),
3995
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
3996
+ ]
3997
+ },
3998
+ opt.id
3999
+ );
4000
+ }) })
4001
+ ] })
4002
+ ] });
4003
+ }
4004
+ function renderStep5() {
4005
+ const modelLabel = models.find((m) => m.id === modelId)?.name ?? labels.modelEmpty;
4006
+ const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
4007
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
4008
+ /* @__PURE__ */ jsx(
4009
+ ReviewBlock,
4010
+ {
4011
+ stepTitle: labels.wizardStep1Title,
4012
+ stepSubtitle: labels.wizardStep1Subtitle,
4013
+ editLabel: labels.wizardReviewEdit,
4014
+ onEdit: () => goToStep(1),
4015
+ children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: presetId === "custom" ? labels.presetCustom : AGENT_PRESETS.find((p) => p.id === presetId)?.name ?? labels.presetCustom })
4016
+ }
4017
+ ),
4018
+ /* @__PURE__ */ jsx(
4019
+ ReviewBlock,
4020
+ {
4021
+ stepTitle: labels.wizardStep2Title,
4022
+ stepSubtitle: labels.wizardStep2Subtitle,
4023
+ editLabel: labels.wizardReviewEdit,
4024
+ onEdit: () => goToStep(2),
4025
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
4026
+ /* @__PURE__ */ jsx(
4027
+ "span",
4028
+ {
4029
+ "aria-hidden": "true",
4030
+ className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${activePreset.accent} text-lg shadow-sm`,
4031
+ children: emoji
4032
+ }
4033
+ ),
4034
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4035
+ /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: name || labels.namePlaceholder }),
4036
+ role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: role }),
4037
+ description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-slate-600 dark:text-slate-300", children: description })
4038
+ ] })
4039
+ ] })
4040
+ }
4041
+ ),
4042
+ /* @__PURE__ */ jsx(
4043
+ ReviewBlock,
4044
+ {
4045
+ stepTitle: labels.wizardStep3Title,
4046
+ stepSubtitle: labels.wizardStep3Subtitle,
4047
+ editLabel: labels.wizardReviewEdit,
4048
+ onEdit: () => goToStep(3),
4049
+ children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4050
+ /* @__PURE__ */ jsx(ReviewRow, { label: labels.connectionLabel, value: connectionLabel }),
4051
+ /* @__PURE__ */ jsx(ReviewRow, { label: labels.frameworkLabel, value: framework || "\u2014" }),
4052
+ /* @__PURE__ */ jsx(ReviewRow, { label: labels.model, value: modelLabel }),
4053
+ outputSchema.trim() && /* @__PURE__ */ jsx(ReviewRow, { label: labels.outputSchemaLabel, value: outputSchema.trim().slice(0, 60) + (outputSchema.length > 60 ? "\u2026" : "") })
4054
+ ] })
4055
+ }
4056
+ ),
4057
+ /* @__PURE__ */ jsxs(
4058
+ ReviewBlock,
4059
+ {
4060
+ stepTitle: labels.wizardStep4Title,
4061
+ stepSubtitle: labels.wizardStep4Subtitle,
4062
+ editLabel: labels.wizardReviewEdit,
4063
+ onEdit: () => goToStep(4),
4064
+ children: [
4065
+ /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: [
4066
+ /* @__PURE__ */ jsx(ReviewRow, { label: labels.temperature, value: temperature.toFixed(2) }),
4067
+ /* @__PURE__ */ jsx(ReviewRow, { label: labels.topPLabel, value: topP.toFixed(2) }),
4150
4068
  /* @__PURE__ */ jsx(ReviewRow, { label: labels.topKLabel, value: String(topK) }),
4151
4069
  /* @__PURE__ */ jsx(ReviewRow, { label: labels.maxTokens, value: maxTokens.toLocaleString() })
4152
4070
  ] }),
@@ -4161,14 +4079,14 @@ function AgentNewWizardPageView({
4161
4079
  }
4162
4080
  const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
4163
4081
  const advanceDisabled = !canAdvance(step);
4164
- const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
4165
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
4166
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4167
- /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
4168
- step < TOTAL_STEPS ? /* @__PURE__ */ jsx(Button, { type: "button", color: "indigo", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "indigo", onClick: () => void submit(), disabled: submitting, children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate })
4169
- ] })
4082
+ const isLast = step === TOTAL_STEPS;
4083
+ const scrollableStep = step === 4 || step === 5;
4084
+ const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
4085
+ const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
4086
+ /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
4087
+ isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
4170
4088
  ] });
4171
- const content = /* @__PURE__ */ jsxs(
4089
+ return /* @__PURE__ */ jsxs(
4172
4090
  "form",
4173
4091
  {
4174
4092
  onSubmit: (e) => {
@@ -4178,15 +4096,12 @@ function AgentNewWizardPageView({
4178
4096
  },
4179
4097
  className: "space-y-4",
4180
4098
  children: [
4181
- /* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
4099
+ hero,
4100
+ /* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
4182
4101
  footer
4183
4102
  ]
4184
4103
  }
4185
4104
  );
4186
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4187
- hero,
4188
- content
4189
- ] });
4190
4105
  }
4191
4106
  function ReviewRow({ label, value }) {
4192
4107
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
@@ -4194,6 +4109,27 @@ function ReviewRow({ label, value }) {
4194
4109
  /* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
4195
4110
  ] });
4196
4111
  }
4112
+ function ReviewBlock({
4113
+ stepTitle,
4114
+ stepSubtitle,
4115
+ editLabel,
4116
+ onEdit,
4117
+ children
4118
+ }) {
4119
+ return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
4120
+ /* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
4121
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4122
+ /* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
4123
+ stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
4124
+ ] }),
4125
+ /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
4126
+ /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4127
+ /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
4128
+ ] })
4129
+ ] }),
4130
+ children
4131
+ ] });
4132
+ }
4197
4133
  var DIALECT_LOGO_SRC = {
4198
4134
  bigquery: "/logos/datasources/bigquery.svg",
4199
4135
  postgres: "/logos/datasources/postgres.svg",
@@ -4405,15 +4341,23 @@ function DatasourceNewWizardPageView({
4405
4341
  id: String(idx + 1),
4406
4342
  title
4407
4343
  }));
4408
- const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS2));
4409
4344
  const hero = /* @__PURE__ */ jsx(
4410
4345
  HeroSection,
4411
4346
  {
4412
4347
  icon: /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
4413
- label: counter,
4414
- title: labels.pageTitle,
4348
+ label: labels.pageTitle,
4349
+ title: stepTitles[step - 1] ?? labels.pageTitle,
4415
4350
  subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
4416
4351
  gradient: category?.gradient ?? "from-amber-500 to-orange-600",
4352
+ actions: /* @__PURE__ */ jsx(
4353
+ IconButton,
4354
+ {
4355
+ label: labels.wizardCancel,
4356
+ icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
4357
+ variant: "ghost",
4358
+ onClick: cancelWithConfirm
4359
+ }
4360
+ ),
4417
4361
  children: /* @__PURE__ */ jsx(
4418
4362
  StepIndicator,
4419
4363
  {
@@ -4427,48 +4371,42 @@ function DatasourceNewWizardPageView({
4427
4371
  }
4428
4372
  );
4429
4373
  function renderStep1() {
4430
- return /* @__PURE__ */ jsx("div", { className: "space-y-6", children: DIALECT_CATEGORIES.map((cat) => {
4374
+ return /* @__PURE__ */ jsx("div", { className: "space-y-5", children: DIALECT_CATEGORIES.map((cat) => {
4431
4375
  const color = CATEGORY_COLOR[cat.id] ?? "slate";
4432
4376
  const categoryLabel = labels[cat.labelKey] ?? cat.id;
4433
- return /* @__PURE__ */ jsx(
4434
- SectionCard,
4435
- {
4436
- variant: "glass",
4437
- header: {
4438
- title: categoryLabel,
4439
- icon: /* @__PURE__ */ jsx(cat.icon, { className: "h-4 w-4" }),
4440
- gradient: cat.gradient
4441
- },
4442
- children: /* @__PURE__ */ jsx(
4443
- "div",
4444
- {
4445
- role: "radiogroup",
4446
- "aria-label": categoryLabel,
4447
- className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
4448
- children: cat.dialects.map((opt) => {
4449
- const selected = opt.value === dialect;
4450
- const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
4451
- return /* @__PURE__ */ jsx(
4452
- FilterTileButton,
4453
- {
4454
- isActive: selected,
4455
- color,
4456
- icon: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
4457
- label: opt.label,
4458
- count: opt.formType.replace("-", " "),
4459
- onClick: () => {
4460
- setDialect(opt.value);
4461
- markTouched();
4462
- }
4463
- },
4464
- opt.value
4465
- );
4466
- })
4467
- }
4468
- )
4469
- },
4470
- cat.id
4471
- );
4377
+ return /* @__PURE__ */ jsxs("div", { children: [
4378
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: [
4379
+ /* @__PURE__ */ jsx(cat.icon, { className: "h-3.5 w-3.5" }),
4380
+ categoryLabel
4381
+ ] }),
4382
+ /* @__PURE__ */ jsx(
4383
+ "div",
4384
+ {
4385
+ role: "radiogroup",
4386
+ "aria-label": categoryLabel,
4387
+ className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
4388
+ children: cat.dialects.map((opt) => {
4389
+ const selected = opt.value === dialect;
4390
+ const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
4391
+ return /* @__PURE__ */ jsx(
4392
+ FilterTileButton,
4393
+ {
4394
+ isActive: selected,
4395
+ color,
4396
+ icon: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
4397
+ label: opt.label,
4398
+ count: opt.formType.replace("-", " "),
4399
+ onClick: () => {
4400
+ setDialect(opt.value);
4401
+ markTouched();
4402
+ }
4403
+ },
4404
+ opt.value
4405
+ );
4406
+ })
4407
+ }
4408
+ )
4409
+ ] }, cat.id);
4472
4410
  }) });
4473
4411
  }
4474
4412
  function renderConnectionFields() {
@@ -4775,257 +4713,220 @@ function DatasourceNewWizardPageView({
4775
4713
  }
4776
4714
  function renderStep2() {
4777
4715
  if (!dialectOption) {
4778
- return /* @__PURE__ */ jsxs(SectionCard, { variant: "glass", header: { title: labels.wizardStep1Title }, children: [
4716
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
4779
4717
  /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: labels.wizardStep1Subtitle }),
4780
- /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack }) })
4718
+ /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack })
4781
4719
  ] });
4782
4720
  }
4783
- return /* @__PURE__ */ jsx(
4784
- SectionCard,
4785
- {
4786
- variant: "glass",
4787
- header: {
4788
- title: dialectOption.label,
4789
- subtitle: labels.wizardStep2Subtitle,
4790
- icon: category?.icon ? /* @__PURE__ */ jsx(category.icon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-4 w-4" }),
4791
- gradient: category?.gradient
4792
- },
4793
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4794
- /* @__PURE__ */ jsx(
4795
- FormInput,
4796
- {
4797
- label: labels.fieldName,
4798
- value: name,
4799
- onValueChange: (v) => {
4800
- setName(v);
4801
- markTouched();
4802
- },
4803
- placeholder: labels.fieldNamePlaceholder,
4804
- required: true
4805
- }
4806
- ),
4807
- /* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
4808
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
4809
- /* @__PURE__ */ jsx(
4810
- FormToggle,
4811
- {
4812
- checked: ssl,
4813
- onChange: (v) => {
4814
- setSsl(v);
4815
- markTouched();
4816
- },
4817
- label: labels.fieldSsl,
4818
- variant: "inline"
4819
- }
4820
- ),
4821
- /* @__PURE__ */ jsx(
4822
- FormToggle,
4823
- {
4824
- checked: readOnly,
4825
- onChange: (v) => {
4826
- setReadOnly(v);
4827
- markTouched();
4828
- },
4829
- label: labels.fieldReadOnly,
4830
- variant: "inline"
4831
- }
4832
- )
4833
- ] }),
4834
- /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
4835
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
4836
- /* @__PURE__ */ jsx(
4837
- Button,
4838
- {
4839
- type: "button",
4840
- outline: true,
4841
- onClick: () => void handleTestConnection(),
4842
- disabled: testStatus === "testing",
4843
- children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
4844
- /* @__PURE__ */ jsx(Spinner, { size: "xs" }),
4845
- labels.testing
4846
- ] }) : labels.testConnection
4847
- }
4848
- ),
4849
- testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
4850
- testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
4851
- ] })
4852
- ] })
4853
- }
4854
- );
4855
- }
4856
- function renderStep3() {
4857
- return /* @__PURE__ */ jsx(
4858
- SectionCard,
4859
- {
4860
- variant: "glass",
4861
- header: {
4862
- title: labels.governanceSectionTitle,
4863
- subtitle: labels.governanceSectionSubtitle
4864
- },
4865
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4866
- /* @__PURE__ */ jsxs(FormGrid, { children: [
4867
- /* @__PURE__ */ jsx(
4868
- FormInput,
4869
- {
4870
- label: labels.fieldMaxPoolSize,
4871
- type: "number",
4872
- min: 1,
4873
- max: 100,
4874
- value: maxPoolSize,
4875
- onValueChange: (v) => {
4876
- setMaxPoolSize(v);
4877
- markTouched();
4878
- },
4879
- hint: labels.fieldMaxPoolSizeHint
4880
- }
4881
- ),
4882
- /* @__PURE__ */ jsx(
4883
- FormInput,
4884
- {
4885
- label: labels.fieldTimeoutMs,
4886
- type: "number",
4887
- min: 100,
4888
- value: timeoutMs,
4889
- onValueChange: (v) => {
4890
- setTimeoutMs(v);
4891
- markTouched();
4892
- },
4893
- hint: labels.fieldTimeoutMsHint
4894
- }
4895
- )
4896
- ] }),
4897
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4898
- /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTables }),
4899
- /* @__PURE__ */ jsx(
4900
- ChipPicker,
4901
- {
4902
- items: allowedTablesItems,
4903
- selectedIds: allowedTablesSelected,
4904
- onChange: (ids) => {
4905
- setAllowedTablesSelected(ids);
4906
- markTouched();
4907
- },
4908
- onItemsChange: (items) => {
4909
- setAllowedTablesItems(items);
4910
- markTouched();
4911
- },
4912
- allowCustom: true,
4913
- unselectedStyle: allowedTablesStyle,
4914
- showActions: false,
4915
- addPlaceholder: labels.fieldAllowedTablesPlaceholder,
4916
- addAriaLabel: labels.fieldAllowedTables
4917
- }
4918
- ),
4919
- /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
4920
- ] }),
4921
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4922
- /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumns }),
4923
- /* @__PURE__ */ jsx(
4924
- ChipPicker,
4925
- {
4926
- items: blockedColumnsItems,
4927
- selectedIds: blockedColumnsSelected,
4928
- onChange: (ids) => {
4929
- setBlockedColumnsSelected(ids);
4930
- markTouched();
4931
- },
4932
- onItemsChange: (items) => {
4933
- setBlockedColumnsItems(items);
4934
- markTouched();
4935
- },
4936
- allowCustom: true,
4937
- unselectedStyle: blockedColumnsStyle,
4938
- showActions: false,
4939
- addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
4940
- addAriaLabel: labels.fieldBlockedColumns
4941
- }
4942
- ),
4943
- /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
4944
- ] }),
4945
- /* @__PURE__ */ jsx(
4946
- FormCheckbox,
4947
- {
4948
- checked: maskPii,
4949
- onChange: (v) => {
4950
- setMaskPii(v);
4951
- markTouched();
4952
- },
4953
- label: labels.fieldMaskPii,
4954
- description: labels.fieldMaskPiiDescription
4955
- }
4956
- )
4957
- ] })
4958
- }
4959
- );
4960
- }
4961
- function renderStep4() {
4962
- const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
4963
- const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
4964
- const allowed = allowedTablesSelected;
4965
- const blocked = blockedColumnsSelected;
4966
4721
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4967
4722
  /* @__PURE__ */ jsx(
4968
- SectionCard,
4969
- {
4970
- variant: "glass",
4971
- header: {
4972
- title: labels.wizardStep1Title,
4973
- subtitle: labels.wizardStep1Subtitle
4974
- },
4975
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
4976
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4977
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4978
- ] }),
4979
- children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4980
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
4981
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
4982
- ] })
4983
- }
4984
- ),
4985
- /* @__PURE__ */ jsx(
4986
- SectionCard,
4723
+ FormInput,
4987
4724
  {
4988
- variant: "glass",
4989
- header: {
4990
- title: labels.wizardStep2Title,
4991
- subtitle: labels.wizardStep2Subtitle
4725
+ label: labels.fieldName,
4726
+ value: name,
4727
+ onValueChange: (v) => {
4728
+ setName(v);
4729
+ markTouched();
4992
4730
  },
4993
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
4994
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4995
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
4996
- ] }),
4997
- children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4998
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
4999
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
5000
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
5001
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
5002
- ] })
4731
+ placeholder: labels.fieldNamePlaceholder,
4732
+ required: true
5003
4733
  }
5004
4734
  ),
5005
- /* @__PURE__ */ jsx(
5006
- SectionCard,
5007
- {
5008
- variant: "glass",
5009
- header: {
5010
- title: labels.wizardStep3Title,
5011
- subtitle: labels.wizardStep3Subtitle
5012
- },
5013
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
5014
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5015
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
5016
- ] }),
5017
- children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
5018
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
5019
- /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
5020
- /* @__PURE__ */ jsx(
5021
- ReviewRow2,
5022
- {
5023
- label: labels.reviewAllowedTablesLabel,
5024
- value: allowed.length > 0 ? allowed.join(", ") : labels.reviewNoneValue
5025
- }
5026
- ),
5027
- /* @__PURE__ */ jsx(
5028
- ReviewRow2,
4735
+ /* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
4736
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
4737
+ /* @__PURE__ */ jsx(
4738
+ FormToggle,
4739
+ {
4740
+ checked: ssl,
4741
+ onChange: (v) => {
4742
+ setSsl(v);
4743
+ markTouched();
4744
+ },
4745
+ label: labels.fieldSsl,
4746
+ variant: "inline"
4747
+ }
4748
+ ),
4749
+ /* @__PURE__ */ jsx(
4750
+ FormToggle,
4751
+ {
4752
+ checked: readOnly,
4753
+ onChange: (v) => {
4754
+ setReadOnly(v);
4755
+ markTouched();
4756
+ },
4757
+ label: labels.fieldReadOnly,
4758
+ variant: "inline"
4759
+ }
4760
+ )
4761
+ ] }),
4762
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
4763
+ /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
4764
+ /* @__PURE__ */ jsx(
4765
+ Button,
4766
+ {
4767
+ type: "button",
4768
+ outline: true,
4769
+ onClick: () => void handleTestConnection(),
4770
+ disabled: testStatus === "testing",
4771
+ children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
4772
+ /* @__PURE__ */ jsx(Spinner, { size: "xs" }),
4773
+ labels.testing
4774
+ ] }) : labels.testConnection
4775
+ }
4776
+ ),
4777
+ testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
4778
+ testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
4779
+ ] })
4780
+ ] });
4781
+ }
4782
+ function renderStep3() {
4783
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
4784
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
4785
+ /* @__PURE__ */ jsx(
4786
+ FormInput,
4787
+ {
4788
+ label: labels.fieldMaxPoolSize,
4789
+ type: "number",
4790
+ min: 1,
4791
+ max: 100,
4792
+ value: maxPoolSize,
4793
+ onValueChange: (v) => {
4794
+ setMaxPoolSize(v);
4795
+ markTouched();
4796
+ },
4797
+ hint: labels.fieldMaxPoolSizeHint
4798
+ }
4799
+ ),
4800
+ /* @__PURE__ */ jsx(
4801
+ FormInput,
4802
+ {
4803
+ label: labels.fieldTimeoutMs,
4804
+ type: "number",
4805
+ min: 100,
4806
+ value: timeoutMs,
4807
+ onValueChange: (v) => {
4808
+ setTimeoutMs(v);
4809
+ markTouched();
4810
+ },
4811
+ hint: labels.fieldTimeoutMsHint
4812
+ }
4813
+ )
4814
+ ] }),
4815
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4816
+ /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTables }),
4817
+ /* @__PURE__ */ jsx(
4818
+ ChipPicker,
4819
+ {
4820
+ items: allowedTablesItems,
4821
+ selectedIds: allowedTablesSelected,
4822
+ onChange: (ids) => {
4823
+ setAllowedTablesSelected(ids);
4824
+ markTouched();
4825
+ },
4826
+ onItemsChange: (items) => {
4827
+ setAllowedTablesItems(items);
4828
+ markTouched();
4829
+ },
4830
+ allowCustom: true,
4831
+ unselectedStyle: allowedTablesStyle,
4832
+ showActions: false,
4833
+ addPlaceholder: labels.fieldAllowedTablesPlaceholder,
4834
+ addAriaLabel: labels.fieldAllowedTables
4835
+ }
4836
+ ),
4837
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
4838
+ ] }),
4839
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4840
+ /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumns }),
4841
+ /* @__PURE__ */ jsx(
4842
+ ChipPicker,
4843
+ {
4844
+ items: blockedColumnsItems,
4845
+ selectedIds: blockedColumnsSelected,
4846
+ onChange: (ids) => {
4847
+ setBlockedColumnsSelected(ids);
4848
+ markTouched();
4849
+ },
4850
+ onItemsChange: (items) => {
4851
+ setBlockedColumnsItems(items);
4852
+ markTouched();
4853
+ },
4854
+ allowCustom: true,
4855
+ unselectedStyle: blockedColumnsStyle,
4856
+ showActions: false,
4857
+ addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
4858
+ addAriaLabel: labels.fieldBlockedColumns
4859
+ }
4860
+ ),
4861
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
4862
+ ] }),
4863
+ /* @__PURE__ */ jsx(
4864
+ FormCheckbox,
4865
+ {
4866
+ checked: maskPii,
4867
+ onChange: (v) => {
4868
+ setMaskPii(v);
4869
+ markTouched();
4870
+ },
4871
+ label: labels.fieldMaskPii,
4872
+ description: labels.fieldMaskPiiDescription
4873
+ }
4874
+ )
4875
+ ] });
4876
+ }
4877
+ function renderStep4() {
4878
+ const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
4879
+ const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
4880
+ const allowed = allowedTablesSelected;
4881
+ const blocked = blockedColumnsSelected;
4882
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
4883
+ /* @__PURE__ */ jsx(
4884
+ ReviewBlock2,
4885
+ {
4886
+ stepTitle: labels.wizardStep1Title,
4887
+ stepSubtitle: labels.wizardStep1Subtitle,
4888
+ editLabel: labels.wizardReviewEdit,
4889
+ onEdit: () => goToStep(1),
4890
+ children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4891
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
4892
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
4893
+ ] })
4894
+ }
4895
+ ),
4896
+ /* @__PURE__ */ jsx(
4897
+ ReviewBlock2,
4898
+ {
4899
+ stepTitle: labels.wizardStep2Title,
4900
+ stepSubtitle: labels.wizardStep2Subtitle,
4901
+ editLabel: labels.wizardReviewEdit,
4902
+ onEdit: () => goToStep(2),
4903
+ children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4904
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
4905
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
4906
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
4907
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
4908
+ ] })
4909
+ }
4910
+ ),
4911
+ /* @__PURE__ */ jsx(
4912
+ ReviewBlock2,
4913
+ {
4914
+ stepTitle: labels.wizardStep3Title,
4915
+ stepSubtitle: labels.wizardStep3Subtitle,
4916
+ editLabel: labels.wizardReviewEdit,
4917
+ onEdit: () => goToStep(3),
4918
+ children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
4919
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
4920
+ /* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
4921
+ /* @__PURE__ */ jsx(
4922
+ ReviewRow2,
4923
+ {
4924
+ label: labels.reviewAllowedTablesLabel,
4925
+ value: allowed.length > 0 ? allowed.join(", ") : labels.reviewNoneValue
4926
+ }
4927
+ ),
4928
+ /* @__PURE__ */ jsx(
4929
+ ReviewRow2,
5029
4930
  {
5030
4931
  label: labels.reviewBlockedColumnsLabel,
5031
4932
  value: blocked.length > 0 ? blocked.join(", ") : labels.reviewNoneValue
@@ -5039,14 +4940,14 @@ function DatasourceNewWizardPageView({
5039
4940
  }
5040
4941
  const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
5041
4942
  const advanceDisabled = !canAdvance(step);
5042
- const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
5043
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
5044
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5045
- /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
5046
- step < TOTAL_STEPS2 ? /* @__PURE__ */ jsx(Button, { type: "button", color: "amber", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "amber", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate })
5047
- ] })
4943
+ const isLast = step === TOTAL_STEPS2;
4944
+ const scrollableStep = step === 1 || step === 4;
4945
+ const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
4946
+ const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
4947
+ /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
4948
+ isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
5048
4949
  ] });
5049
- const content = /* @__PURE__ */ jsxs(
4950
+ return /* @__PURE__ */ jsxs(
5050
4951
  "form",
5051
4952
  {
5052
4953
  onSubmit: (e) => {
@@ -5056,15 +4957,12 @@ function DatasourceNewWizardPageView({
5056
4957
  },
5057
4958
  className: "space-y-4",
5058
4959
  children: [
5059
- /* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
4960
+ hero,
4961
+ /* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
5060
4962
  footer
5061
4963
  ]
5062
4964
  }
5063
4965
  );
5064
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5065
- hero,
5066
- content
5067
- ] });
5068
4966
  }
5069
4967
  function ReviewRow2({ label, value }) {
5070
4968
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
@@ -5072,6 +4970,27 @@ function ReviewRow2({ label, value }) {
5072
4970
  /* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
5073
4971
  ] });
5074
4972
  }
4973
+ function ReviewBlock2({
4974
+ stepTitle,
4975
+ stepSubtitle,
4976
+ editLabel,
4977
+ onEdit,
4978
+ children
4979
+ }) {
4980
+ return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
4981
+ /* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
4982
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4983
+ /* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
4984
+ stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
4985
+ ] }),
4986
+ /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
4987
+ /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
4988
+ /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
4989
+ ] })
4990
+ ] }),
4991
+ children
4992
+ ] });
4993
+ }
5075
4994
  async function simulateTest() {
5076
4995
  await new Promise((r) => setTimeout(r, 1500));
5077
4996
  return true;
@@ -5321,15 +5240,23 @@ function RuleNewWizardPageView({
5321
5240
  id: String(idx + 1),
5322
5241
  title
5323
5242
  }));
5324
- const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS3));
5325
5243
  const hero = /* @__PURE__ */ jsx(
5326
5244
  HeroSection,
5327
5245
  {
5328
5246
  icon: /* @__PURE__ */ jsx(AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
5329
- label: counter,
5330
- title: labels.pageTitle,
5247
+ label: labels.pageTitle,
5248
+ title: stepTitles[step - 1] ?? labels.pageTitle,
5331
5249
  subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
5332
5250
  gradient: "from-fuchsia-500 to-purple-700",
5251
+ actions: /* @__PURE__ */ jsx(
5252
+ IconButton,
5253
+ {
5254
+ label: labels.wizardCancel,
5255
+ icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
5256
+ variant: "ghost",
5257
+ onClick: cancelWithConfirm
5258
+ }
5259
+ ),
5333
5260
  children: /* @__PURE__ */ jsx(
5334
5261
  StepIndicator,
5335
5262
  {
@@ -5343,399 +5270,346 @@ function RuleNewWizardPageView({
5343
5270
  }
5344
5271
  );
5345
5272
  function renderStep1() {
5346
- return /* @__PURE__ */ jsx(
5347
- SectionCard,
5348
- {
5349
- variant: "glass",
5350
- header: {
5351
- title: labels.wizardStep1Title,
5352
- subtitle: labels.wizardStep1Subtitle
5353
- },
5354
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5355
- /* @__PURE__ */ jsx(
5356
- FormInput,
5357
- {
5358
- label: labels.nameLabel,
5359
- value: name,
5360
- onValueChange: (v) => {
5361
- setName(v);
5362
- markTouched();
5363
- },
5364
- placeholder: labels.namePlaceholder,
5365
- required: true
5366
- }
5367
- ),
5368
- /* @__PURE__ */ jsx(
5369
- FormTextarea,
5370
- {
5371
- label: labels.descriptionLabel,
5372
- value: description,
5373
- onValueChange: (v) => {
5374
- setDescription(v);
5375
- markTouched();
5376
- },
5377
- placeholder: labels.descriptionPlaceholder,
5378
- rows: 3
5379
- }
5380
- ),
5381
- /* @__PURE__ */ jsx(
5382
- RangeSliderField2,
5383
- {
5384
- sliderId: "wizard-rule-priority",
5385
- label: labels.priorityLabel,
5386
- value: priority,
5387
- onChange: (v) => {
5388
- setPriority(Math.round(v));
5389
- markTouched();
5390
- },
5391
- min: 0,
5392
- max: 100,
5393
- step: 1,
5394
- trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
5395
- formatValue: (v) => String(Math.round(v)),
5396
- zones: [
5397
- { label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
5398
- { label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
5399
- { label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
5400
- { label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
5401
- ]
5402
- }
5403
- ),
5404
- /* @__PURE__ */ jsx(
5405
- FormToggle,
5406
- {
5407
- checked: enabled,
5408
- onChange: (v) => {
5409
- setEnabled(v);
5410
- markTouched();
5411
- },
5412
- label: labels.enabledLabel,
5413
- variant: "card"
5414
- }
5415
- )
5416
- ] })
5417
- }
5418
- );
5273
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5274
+ /* @__PURE__ */ jsx(
5275
+ FormInput,
5276
+ {
5277
+ label: labels.nameLabel,
5278
+ value: name,
5279
+ onValueChange: (v) => {
5280
+ setName(v);
5281
+ markTouched();
5282
+ },
5283
+ placeholder: labels.namePlaceholder,
5284
+ required: true
5285
+ }
5286
+ ),
5287
+ /* @__PURE__ */ jsx(
5288
+ FormTextarea,
5289
+ {
5290
+ label: labels.descriptionLabel,
5291
+ value: description,
5292
+ onValueChange: (v) => {
5293
+ setDescription(v);
5294
+ markTouched();
5295
+ },
5296
+ placeholder: labels.descriptionPlaceholder,
5297
+ rows: 3
5298
+ }
5299
+ ),
5300
+ /* @__PURE__ */ jsx(
5301
+ RangeSliderField2,
5302
+ {
5303
+ sliderId: "wizard-rule-priority",
5304
+ label: labels.priorityLabel,
5305
+ value: priority,
5306
+ onChange: (v) => {
5307
+ setPriority(Math.round(v));
5308
+ markTouched();
5309
+ },
5310
+ min: 0,
5311
+ max: 100,
5312
+ step: 1,
5313
+ trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
5314
+ formatValue: (v) => String(Math.round(v)),
5315
+ zones: [
5316
+ { label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
5317
+ { label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
5318
+ { label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
5319
+ { label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
5320
+ ]
5321
+ }
5322
+ ),
5323
+ /* @__PURE__ */ jsx(
5324
+ FormToggle,
5325
+ {
5326
+ checked: enabled,
5327
+ onChange: (v) => {
5328
+ setEnabled(v);
5329
+ markTouched();
5330
+ },
5331
+ label: labels.enabledLabel,
5332
+ variant: "card"
5333
+ }
5334
+ )
5335
+ ] });
5419
5336
  }
5420
5337
  function renderStep2() {
5421
- return /* @__PURE__ */ jsx(
5422
- SectionCard,
5423
- {
5424
- variant: "glass",
5425
- header: {
5426
- title: labels.conditionSectionTitle,
5427
- subtitle: labels.conditionSectionSubtitle
5428
- },
5429
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5430
- /* @__PURE__ */ jsxs("div", { children: [
5431
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
5432
- /* @__PURE__ */ jsx(
5433
- SegmentedControl,
5434
- {
5435
- segments: [
5436
- { value: "and", label: labels.combinatorAnd },
5437
- { value: "or", label: labels.combinatorOr },
5438
- { value: "not", label: labels.combinatorNot }
5439
- ],
5440
- value: combinator,
5441
- onChange: (v) => {
5442
- setCombinator(v);
5443
- markTouched();
5444
- },
5445
- size: "sm"
5446
- }
5447
- )
5448
- ] }),
5449
- /* @__PURE__ */ jsx(
5450
- RuleConditionBuilder,
5451
- {
5452
- value: condition,
5453
- onChange: (next) => {
5454
- setCondition(next);
5455
- markTouched();
5456
- }
5457
- }
5458
- )
5459
- ] })
5460
- }
5461
- );
5338
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5339
+ /* @__PURE__ */ jsxs("div", { children: [
5340
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
5341
+ /* @__PURE__ */ jsx(
5342
+ SegmentedControl,
5343
+ {
5344
+ segments: [
5345
+ { value: "and", label: labels.combinatorAnd },
5346
+ { value: "or", label: labels.combinatorOr },
5347
+ { value: "not", label: labels.combinatorNot }
5348
+ ],
5349
+ value: combinator,
5350
+ onChange: (v) => {
5351
+ setCombinator(v);
5352
+ markTouched();
5353
+ },
5354
+ size: "sm"
5355
+ }
5356
+ )
5357
+ ] }),
5358
+ /* @__PURE__ */ jsx(
5359
+ RuleConditionBuilder,
5360
+ {
5361
+ value: condition,
5362
+ onChange: (next) => {
5363
+ setCondition(next);
5364
+ markTouched();
5365
+ }
5366
+ }
5367
+ )
5368
+ ] });
5462
5369
  }
5463
5370
  function renderStep3() {
5464
- const selectedTile = ACTION_TILES.find((t) => t.id === actionTileId) ?? null;
5465
- return /* @__PURE__ */ jsx(
5466
- SectionCard,
5467
- {
5468
- variant: "glass",
5469
- header: {
5470
- title: labels.actionSectionTitle,
5471
- subtitle: labels.actionSectionSubtitle
5472
- },
5473
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
5474
- /* @__PURE__ */ jsx(
5475
- "div",
5476
- {
5477
- role: "radiogroup",
5478
- "aria-label": labels.actionSectionTitle,
5479
- className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
5480
- children: ACTION_TILES.map((tile) => {
5481
- const Icon = tile.icon;
5482
- const selected = tile.id === actionTileId;
5483
- const label = labels[tile.labelKey] ?? tile.id;
5484
- const description2 = labels[tile.descriptionKey] ?? "";
5485
- return /* @__PURE__ */ jsx(
5486
- FilterTileButton,
5487
- {
5488
- isActive: selected,
5489
- color: tile.color,
5490
- icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
5491
- label,
5492
- count: description2,
5493
- onClick: () => {
5494
- setActionTileId(tile.id);
5495
- markTouched();
5496
- }
5497
- },
5498
- tile.id
5499
- );
5500
- })
5501
- }
5502
- ),
5503
- selectedTile && /* @__PURE__ */ jsx(
5504
- SectionCard,
5505
- {
5506
- variant: "glass",
5507
- header: {
5508
- title: labels[selectedTile.labelKey] ?? selectedTile.id,
5509
- subtitle: labels.actionConfigSubtitle
5510
- },
5511
- children: /* @__PURE__ */ jsx(
5512
- RuleActionBuilder,
5513
- {
5514
- value: action,
5515
- onChange: (next) => {
5516
- setAction(next);
5517
- markTouched();
5518
- }
5371
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
5372
+ /* @__PURE__ */ jsx(
5373
+ "div",
5374
+ {
5375
+ role: "radiogroup",
5376
+ "aria-label": labels.actionSectionTitle,
5377
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
5378
+ children: ACTION_TILES.map((tile) => {
5379
+ const Icon = tile.icon;
5380
+ const selected = tile.id === actionTileId;
5381
+ const label = labels[tile.labelKey] ?? tile.id;
5382
+ const description2 = labels[tile.descriptionKey] ?? "";
5383
+ return /* @__PURE__ */ jsx(
5384
+ FilterTileButton,
5385
+ {
5386
+ isActive: selected,
5387
+ color: tile.color,
5388
+ icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
5389
+ label,
5390
+ count: description2,
5391
+ onClick: () => {
5392
+ setActionTileId(tile.id);
5393
+ markTouched();
5519
5394
  }
5520
- )
5395
+ },
5396
+ tile.id
5397
+ );
5398
+ })
5399
+ }
5400
+ ),
5401
+ actionTileId && /* @__PURE__ */ jsxs("div", { className: "border-t liquid-divider pt-4", children: [
5402
+ /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-slate-500 dark:text-slate-400", children: labels.actionConfigSubtitle }),
5403
+ /* @__PURE__ */ jsx(
5404
+ RuleActionBuilder,
5405
+ {
5406
+ value: action,
5407
+ onChange: (next) => {
5408
+ setAction(next);
5409
+ markTouched();
5521
5410
  }
5522
- )
5523
- ] })
5524
- }
5525
- );
5411
+ }
5412
+ )
5413
+ ] })
5414
+ ] });
5526
5415
  }
5527
5416
  function renderStep4() {
5528
- return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsx(
5529
- SectionCard,
5530
- {
5531
- variant: "glass",
5532
- header: {
5533
- title: labels.scheduleSectionTitle,
5534
- subtitle: labels.scheduleSectionSubtitle
5535
- },
5536
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
5537
- /* @__PURE__ */ jsxs(FormGrid, { children: [
5538
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5539
- /* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
5540
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
5541
- /* @__PURE__ */ jsx(
5542
- DatePicker,
5543
- {
5544
- value: validFromDate,
5545
- onChange: (d) => {
5546
- setValidFromDate(d);
5547
- markTouched();
5548
- },
5549
- placeholder: labels.validFromDateLabel
5550
- }
5551
- ),
5552
- /* @__PURE__ */ jsx(
5553
- TimePicker,
5554
- {
5555
- value: validFromTime,
5556
- onChange: (t) => {
5557
- setValidFromTime(t);
5558
- markTouched();
5559
- },
5560
- placeholder: labels.validFromTimeLabel
5561
- }
5562
- )
5563
- ] })
5564
- ] }),
5565
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5566
- /* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
5567
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
5568
- /* @__PURE__ */ jsx(
5569
- DatePicker,
5570
- {
5571
- value: validUntilDate,
5572
- onChange: (d) => {
5573
- setValidUntilDate(d);
5574
- markTouched();
5575
- },
5576
- placeholder: labels.validUntilDateLabel
5577
- }
5578
- ),
5579
- /* @__PURE__ */ jsx(
5580
- TimePicker,
5581
- {
5582
- value: validUntilTime,
5583
- onChange: (t) => {
5584
- setValidUntilTime(t);
5585
- markTouched();
5586
- },
5587
- placeholder: labels.validUntilTimeLabel
5588
- }
5589
- )
5590
- ] })
5591
- ] })
5592
- ] }),
5593
- /* @__PURE__ */ jsx(
5594
- FormCheckbox,
5595
- {
5596
- checked: noExpiry,
5597
- onChange: (v) => {
5598
- setNoExpiry(v);
5599
- markTouched();
5600
- },
5601
- label: labels.noExpiryLabel,
5602
- description: labels.noExpiryDescription
5603
- }
5604
- ),
5605
- /* @__PURE__ */ jsxs("div", { children: [
5606
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
5417
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
5418
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
5419
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5420
+ /* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
5421
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
5607
5422
  /* @__PURE__ */ jsx(
5608
- SegmentedControl,
5423
+ DatePicker,
5609
5424
  {
5610
- segments: [
5611
- { value: "active", label: labels.statusActive },
5612
- { value: "paused", label: labels.statusPaused },
5613
- { value: "archived", label: labels.statusArchived }
5614
- ],
5615
- value: status,
5616
- onChange: (v) => {
5617
- setStatus(v);
5425
+ value: validFromDate,
5426
+ onChange: (d) => {
5427
+ setValidFromDate(d);
5618
5428
  markTouched();
5619
5429
  },
5620
- size: "sm"
5430
+ placeholder: labels.validFromDateLabel
5621
5431
  }
5622
- )
5623
- ] }),
5624
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
5625
- /* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
5432
+ ),
5626
5433
  /* @__PURE__ */ jsx(
5627
- ChipPicker,
5434
+ TimePicker,
5628
5435
  {
5629
- items: tagsItems,
5630
- selectedIds: tagsSelected,
5631
- onChange: (ids) => {
5632
- setTagsSelected(ids);
5436
+ value: validFromTime,
5437
+ onChange: (t) => {
5438
+ setValidFromTime(t);
5633
5439
  markTouched();
5634
5440
  },
5635
- onItemsChange: (items) => {
5636
- setTagsItems(items);
5441
+ placeholder: labels.validFromTimeLabel
5442
+ }
5443
+ )
5444
+ ] })
5445
+ ] }),
5446
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5447
+ /* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
5448
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
5449
+ /* @__PURE__ */ jsx(
5450
+ DatePicker,
5451
+ {
5452
+ value: validUntilDate,
5453
+ onChange: (d) => {
5454
+ setValidUntilDate(d);
5637
5455
  markTouched();
5638
5456
  },
5639
- allowCustom: true,
5640
- unselectedStyle: tagsStyle,
5641
- showActions: false,
5642
- addPlaceholder: labels.tagsPlaceholder,
5643
- addAriaLabel: labels.tagsLabel
5457
+ placeholder: labels.validUntilDateLabel
5644
5458
  }
5645
5459
  ),
5646
- /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
5647
- ] }),
5648
- /* @__PURE__ */ jsxs("div", { children: [
5649
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
5650
5460
  /* @__PURE__ */ jsx(
5651
- SegmentedControl,
5461
+ TimePicker,
5652
5462
  {
5653
- segments: [
5654
- { value: "one-off", label: labels.recurrenceOneOff },
5655
- { value: "cron", label: labels.recurrenceCron },
5656
- { value: "recurring", label: labels.recurrenceRecurring }
5657
- ],
5658
- value: recurrence,
5659
- onChange: (v) => {
5660
- setRecurrence(v);
5463
+ value: validUntilTime,
5464
+ onChange: (t) => {
5465
+ setValidUntilTime(t);
5661
5466
  markTouched();
5662
5467
  },
5663
- size: "sm"
5468
+ placeholder: labels.validUntilTimeLabel
5664
5469
  }
5665
5470
  )
5666
- ] }),
5667
- recurrence === "cron" && /* @__PURE__ */ jsx(
5668
- FormInput,
5471
+ ] })
5472
+ ] })
5473
+ ] }),
5474
+ /* @__PURE__ */ jsx(
5475
+ FormCheckbox,
5476
+ {
5477
+ checked: noExpiry,
5478
+ onChange: (v) => {
5479
+ setNoExpiry(v);
5480
+ markTouched();
5481
+ },
5482
+ label: labels.noExpiryLabel,
5483
+ description: labels.noExpiryDescription
5484
+ }
5485
+ ),
5486
+ /* @__PURE__ */ jsxs("div", { children: [
5487
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
5488
+ /* @__PURE__ */ jsx(
5489
+ SegmentedControl,
5490
+ {
5491
+ segments: [
5492
+ { value: "active", label: labels.statusActive },
5493
+ { value: "paused", label: labels.statusPaused },
5494
+ { value: "archived", label: labels.statusArchived }
5495
+ ],
5496
+ value: status,
5497
+ onChange: (v) => {
5498
+ setStatus(v);
5499
+ markTouched();
5500
+ },
5501
+ size: "sm"
5502
+ }
5503
+ )
5504
+ ] }),
5505
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
5506
+ /* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
5507
+ /* @__PURE__ */ jsx(
5508
+ ChipPicker,
5509
+ {
5510
+ items: tagsItems,
5511
+ selectedIds: tagsSelected,
5512
+ onChange: (ids) => {
5513
+ setTagsSelected(ids);
5514
+ markTouched();
5515
+ },
5516
+ onItemsChange: (items) => {
5517
+ setTagsItems(items);
5518
+ markTouched();
5519
+ },
5520
+ allowCustom: true,
5521
+ unselectedStyle: tagsStyle,
5522
+ showActions: false,
5523
+ addPlaceholder: labels.tagsPlaceholder,
5524
+ addAriaLabel: labels.tagsLabel
5525
+ }
5526
+ ),
5527
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
5528
+ ] }),
5529
+ /* @__PURE__ */ jsxs("div", { children: [
5530
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
5531
+ /* @__PURE__ */ jsx(
5532
+ SegmentedControl,
5533
+ {
5534
+ segments: [
5535
+ { value: "one-off", label: labels.recurrenceOneOff },
5536
+ { value: "cron", label: labels.recurrenceCron },
5537
+ { value: "recurring", label: labels.recurrenceRecurring }
5538
+ ],
5539
+ value: recurrence,
5540
+ onChange: (v) => {
5541
+ setRecurrence(v);
5542
+ markTouched();
5543
+ },
5544
+ size: "sm"
5545
+ }
5546
+ )
5547
+ ] }),
5548
+ recurrence === "cron" && /* @__PURE__ */ jsx(
5549
+ FormInput,
5550
+ {
5551
+ label: labels.cronExpressionLabel,
5552
+ value: cronExpression,
5553
+ onValueChange: (v) => {
5554
+ setCronExpression(v);
5555
+ markTouched();
5556
+ },
5557
+ placeholder: labels.cronExpressionPlaceholder,
5558
+ hint: labels.cronExpressionHint
5559
+ }
5560
+ ),
5561
+ recurrence === "recurring" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
5562
+ /* @__PURE__ */ jsxs("div", { children: [
5563
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
5564
+ /* @__PURE__ */ jsx(
5565
+ ChipPicker,
5669
5566
  {
5670
- label: labels.cronExpressionLabel,
5671
- value: cronExpression,
5672
- onValueChange: (v) => {
5673
- setCronExpression(v);
5567
+ items: WEEKDAYS.map((d) => ({
5568
+ id: d.id,
5569
+ name: labels[d.labelKey] ?? d.id,
5570
+ style: {
5571
+ bg: "bg-fuchsia-500/15",
5572
+ text: "text-fuchsia-700 dark:text-fuchsia-300"
5573
+ }
5574
+ })),
5575
+ selectedIds: weekdays,
5576
+ onChange: (ids) => {
5577
+ setWeekdays(ids);
5674
5578
  markTouched();
5675
5579
  },
5676
- placeholder: labels.cronExpressionPlaceholder,
5677
- hint: labels.cronExpressionHint
5580
+ showActions: false
5678
5581
  }
5679
- ),
5680
- recurrence === "recurring" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
5681
- /* @__PURE__ */ jsxs("div", { children: [
5682
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
5683
- /* @__PURE__ */ jsx(
5684
- ChipPicker,
5685
- {
5686
- items: WEEKDAYS.map((d) => ({
5687
- id: d.id,
5688
- name: labels[d.labelKey] ?? d.id,
5689
- style: {
5690
- bg: "bg-fuchsia-500/15",
5691
- text: "text-fuchsia-700 dark:text-fuchsia-300"
5692
- }
5693
- })),
5694
- selectedIds: weekdays,
5695
- onChange: (ids) => {
5696
- setWeekdays(ids);
5697
- markTouched();
5698
- },
5699
- showActions: false
5700
- }
5701
- )
5702
- ] }),
5703
- /* @__PURE__ */ jsxs("div", { children: [
5704
- /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
5705
- /* @__PURE__ */ jsx(
5706
- TimePicker,
5707
- {
5708
- value: recurringTime,
5709
- onChange: (t) => {
5710
- setRecurringTime(t);
5711
- markTouched();
5712
- },
5713
- placeholder: labels.timeOfDayLabel
5714
- }
5715
- )
5716
- ] })
5717
- ] })
5582
+ )
5583
+ ] }),
5584
+ /* @__PURE__ */ jsxs("div", { children: [
5585
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
5586
+ /* @__PURE__ */ jsx(
5587
+ TimePicker,
5588
+ {
5589
+ value: recurringTime,
5590
+ onChange: (t) => {
5591
+ setRecurringTime(t);
5592
+ markTouched();
5593
+ },
5594
+ placeholder: labels.timeOfDayLabel
5595
+ }
5596
+ )
5718
5597
  ] })
5719
- }
5720
- ) });
5598
+ ] })
5599
+ ] });
5721
5600
  }
5722
5601
  function renderStep5() {
5723
5602
  const payload = buildPayload();
5724
5603
  const conditionSentence = humanReadableCondition(payload.condition, labels);
5725
5604
  const actionSentence = humanReadableAction(payload.action, labels, ACTION_TILES, actionTileId);
5726
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5605
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
5727
5606
  /* @__PURE__ */ jsx(
5728
- SectionCard,
5607
+ ReviewBlock3,
5729
5608
  {
5730
- variant: "glass",
5731
- header: {
5732
- title: labels.wizardStep1Title,
5733
- subtitle: labels.wizardStep1Subtitle
5734
- },
5735
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
5736
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5737
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
5738
- ] }),
5609
+ stepTitle: labels.wizardStep1Title,
5610
+ stepSubtitle: labels.wizardStep1Subtitle,
5611
+ editLabel: labels.wizardReviewEdit,
5612
+ onEdit: () => goToStep(1),
5739
5613
  children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
5740
5614
  /* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewNameLabel, value: payload.name }),
5741
5615
  /* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewPriorityLabel, value: String(payload.priority) }),
@@ -5751,54 +5625,35 @@ function RuleNewWizardPageView({
5751
5625
  }
5752
5626
  ),
5753
5627
  /* @__PURE__ */ jsxs(
5754
- SectionCard,
5628
+ ReviewBlock3,
5755
5629
  {
5756
- variant: "glass",
5757
- header: {
5758
- title: labels.wizardStep2Title,
5759
- subtitle: labels.wizardStep2Subtitle
5760
- },
5761
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
5762
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5763
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
5764
- ] }),
5630
+ stepTitle: labels.wizardStep2Title,
5631
+ stepSubtitle: labels.wizardStep2Subtitle,
5632
+ editLabel: labels.wizardReviewEdit,
5633
+ onEdit: () => goToStep(2),
5765
5634
  children: [
5766
5635
  /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: conditionSentence }),
5767
- /* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() }),
5768
- /* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.condition, null, 2) })
5636
+ /* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() })
5769
5637
  ]
5770
5638
  }
5771
5639
  ),
5772
- /* @__PURE__ */ jsxs(
5773
- SectionCard,
5640
+ /* @__PURE__ */ jsx(
5641
+ ReviewBlock3,
5774
5642
  {
5775
- variant: "glass",
5776
- header: {
5777
- title: labels.wizardStep3Title,
5778
- subtitle: labels.wizardStep3Subtitle
5779
- },
5780
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
5781
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5782
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
5783
- ] }),
5784
- children: [
5785
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: actionSentence }),
5786
- /* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.action, null, 2) })
5787
- ]
5643
+ stepTitle: labels.wizardStep3Title,
5644
+ stepSubtitle: labels.wizardStep3Subtitle,
5645
+ editLabel: labels.wizardReviewEdit,
5646
+ onEdit: () => goToStep(3),
5647
+ children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: actionSentence })
5788
5648
  }
5789
5649
  ),
5790
5650
  /* @__PURE__ */ jsx(
5791
- SectionCard,
5651
+ ReviewBlock3,
5792
5652
  {
5793
- variant: "glass",
5794
- header: {
5795
- title: labels.wizardStep4Title,
5796
- subtitle: labels.wizardStep4Subtitle
5797
- },
5798
- actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
5799
- /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5800
- /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
5801
- ] }),
5653
+ stepTitle: labels.wizardStep4Title,
5654
+ stepSubtitle: labels.wizardStep4Subtitle,
5655
+ editLabel: labels.wizardReviewEdit,
5656
+ onEdit: () => goToStep(4),
5802
5657
  children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
5803
5658
  /* @__PURE__ */ jsx(
5804
5659
  ReviewRow3,
@@ -5830,23 +5685,23 @@ function RuleNewWizardPageView({
5830
5685
  }
5831
5686
  const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
5832
5687
  const advanceDisabled = !canAdvance(step);
5833
- const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
5834
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
5835
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5836
- /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
5837
- step < TOTAL_STEPS3 ? /* @__PURE__ */ jsx(Button, { type: "button", color: "fuchsia", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(
5838
- Button,
5839
- {
5840
- type: "button",
5841
- color: "fuchsia",
5842
- onClick: () => void submit(),
5843
- disabled: submitting || !name.trim() || !actionTileId,
5844
- children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
5845
- }
5846
- )
5847
- ] })
5688
+ const isLast = step === TOTAL_STEPS3;
5689
+ const scrollableStep = step === 2 || step === 3 || step === 4 || step === 5;
5690
+ const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
5691
+ const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
5692
+ /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
5693
+ isLast ? /* @__PURE__ */ jsx(
5694
+ Button,
5695
+ {
5696
+ type: "button",
5697
+ color: "ios-glass-blue",
5698
+ onClick: () => void submit(),
5699
+ disabled: submitting || !name.trim() || !actionTileId,
5700
+ children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
5701
+ }
5702
+ ) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
5848
5703
  ] });
5849
- const content = /* @__PURE__ */ jsxs(
5704
+ return /* @__PURE__ */ jsxs(
5850
5705
  "form",
5851
5706
  {
5852
5707
  onSubmit: (e) => {
@@ -5856,15 +5711,12 @@ function RuleNewWizardPageView({
5856
5711
  },
5857
5712
  className: "space-y-4",
5858
5713
  children: [
5859
- /* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
5714
+ hero,
5715
+ /* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
5860
5716
  footer
5861
5717
  ]
5862
5718
  }
5863
5719
  );
5864
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5865
- hero,
5866
- content
5867
- ] });
5868
5720
  }
5869
5721
  function ReviewRow3({ label, value }) {
5870
5722
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
@@ -5872,6 +5724,27 @@ function ReviewRow3({ label, value }) {
5872
5724
  /* @__PURE__ */ jsx("dd", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs font-semibold text-slate-900 dark:text-white", children: value })
5873
5725
  ] });
5874
5726
  }
5727
+ function ReviewBlock3({
5728
+ stepTitle,
5729
+ stepSubtitle,
5730
+ editLabel,
5731
+ onEdit,
5732
+ children
5733
+ }) {
5734
+ return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
5735
+ /* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
5736
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
5737
+ /* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
5738
+ stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
5739
+ ] }),
5740
+ /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
5741
+ /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
5742
+ /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
5743
+ ] })
5744
+ ] }),
5745
+ children
5746
+ ] });
5747
+ }
5875
5748
  function pad(n) {
5876
5749
  return String(n).padStart(2, "0");
5877
5750
  }
@@ -6108,15 +5981,23 @@ function ModelNewWizardPageView({
6108
5981
  const stepTitles = [labels.step1Title, labels.step2Title, labels.step3Title, labels.step4Title];
6109
5982
  const stepSubtitles = [labels.step1Subtitle, labels.step2Subtitle, labels.step3Subtitle, labels.step4Subtitle];
6110
5983
  const indicatorSteps = stepTitles.map((title, idx) => ({ id: String(idx + 1), title }));
6111
- const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS4));
6112
5984
  const hero = /* @__PURE__ */ jsx(
6113
5985
  HeroSection,
6114
5986
  {
6115
5987
  icon: /* @__PURE__ */ jsx(CubeTransparentIcon, { className: "h-5 w-5" }),
6116
- label: counter,
6117
- title: labels.pageTitle,
5988
+ label: labels.pageTitle,
5989
+ title: stepTitles[step - 1] ?? labels.pageTitle,
6118
5990
  subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
6119
5991
  gradient: "from-emerald-500 to-teal-700",
5992
+ actions: /* @__PURE__ */ jsx(
5993
+ IconButton,
5994
+ {
5995
+ label: labels.wizardCancel,
5996
+ icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
5997
+ variant: "ghost",
5998
+ onClick: cancelWithConfirm
5999
+ }
6000
+ ),
6120
6001
  children: /* @__PURE__ */ jsx(
6121
6002
  StepIndicator,
6122
6003
  {
@@ -6131,185 +6012,166 @@ function ModelNewWizardPageView({
6131
6012
  );
6132
6013
  function renderStep1() {
6133
6014
  return /* @__PURE__ */ jsx(
6134
- SectionCard,
6135
- {
6136
- variant: "glass",
6137
- header: { title: labels.providerLabel, subtitle: labels.step1Subtitle },
6138
- children: /* @__PURE__ */ jsx(
6139
- "div",
6140
- {
6141
- role: "radiogroup",
6142
- "aria-label": labels.providerLabel,
6143
- className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
6144
- children: MODEL_PROVIDERS.map((p) => {
6145
- const Icon = PROVIDER_ICON[p.value] ?? GlobeAltIcon;
6146
- const color = PROVIDER_COLOR[p.value] ?? "slate";
6147
- const selected = providerSlug === p.value;
6148
- return /* @__PURE__ */ jsx(
6149
- FilterTileButton,
6150
- {
6151
- isActive: selected,
6152
- color,
6153
- icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
6154
- label: p.label,
6155
- count: p.category,
6156
- onClick: () => {
6157
- setProviderSlug(p.value);
6158
- markTouched();
6159
- }
6160
- },
6161
- p.value
6162
- );
6163
- })
6164
- }
6165
- )
6166
- }
6167
- );
6168
- }
6169
- function renderStep2() {
6170
- return /* @__PURE__ */ jsx(
6171
- SectionCard,
6015
+ "div",
6172
6016
  {
6173
- variant: "glass",
6174
- header: { title: preset.label, subtitle: labels.step2Subtitle },
6175
- children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs(FormGrid, { children: [
6176
- /* @__PURE__ */ jsx(
6177
- FormInput,
6178
- {
6179
- label: labels.nameLabel,
6180
- value: name,
6181
- onValueChange: (v) => {
6182
- setName(v);
6183
- markTouched();
6184
- },
6185
- placeholder: labels.namePlaceholder || `${preset.label} \u2014 produ\xE7\xE3o`,
6186
- required: true
6187
- }
6188
- ),
6189
- /* @__PURE__ */ jsx(
6190
- FormInput,
6017
+ role: "radiogroup",
6018
+ "aria-label": labels.providerLabel,
6019
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
6020
+ children: MODEL_PROVIDERS.map((p) => {
6021
+ const Icon = PROVIDER_ICON[p.value] ?? GlobeAltIcon;
6022
+ const color = PROVIDER_COLOR[p.value] ?? "slate";
6023
+ const selected = providerSlug === p.value;
6024
+ return /* @__PURE__ */ jsx(
6025
+ FilterTileButton,
6191
6026
  {
6192
- label: labels.apiKeyLabel,
6193
- type: "password",
6194
- value: apiKey,
6195
- onValueChange: (v) => {
6196
- setApiKey(v);
6027
+ isActive: selected,
6028
+ color,
6029
+ icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
6030
+ label: p.label,
6031
+ count: p.category,
6032
+ onClick: () => {
6033
+ setProviderSlug(p.value);
6197
6034
  markTouched();
6198
- },
6199
- placeholder: labels.apiKeyPlaceholder
6200
- }
6201
- )
6202
- ] }) })
6035
+ }
6036
+ },
6037
+ p.value
6038
+ );
6039
+ })
6203
6040
  }
6204
6041
  );
6205
6042
  }
6043
+ function renderStep2() {
6044
+ return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs(FormGrid, { children: [
6045
+ /* @__PURE__ */ jsx(
6046
+ FormInput,
6047
+ {
6048
+ label: labels.nameLabel,
6049
+ value: name,
6050
+ onValueChange: (v) => {
6051
+ setName(v);
6052
+ markTouched();
6053
+ },
6054
+ placeholder: labels.namePlaceholder || `${preset.label} \u2014 produ\xE7\xE3o`,
6055
+ required: true
6056
+ }
6057
+ ),
6058
+ /* @__PURE__ */ jsx(
6059
+ FormInput,
6060
+ {
6061
+ label: labels.apiKeyLabel,
6062
+ type: "password",
6063
+ value: apiKey,
6064
+ onValueChange: (v) => {
6065
+ setApiKey(v);
6066
+ markTouched();
6067
+ },
6068
+ placeholder: labels.apiKeyPlaceholder
6069
+ }
6070
+ )
6071
+ ] }) });
6072
+ }
6206
6073
  function renderStep3() {
6207
6074
  const showRegion = preset.needsRegion === true;
6208
6075
  const showEndpoint = preset.needsEndpoint === true;
6209
- return /* @__PURE__ */ jsx(
6210
- SectionCard,
6211
- {
6212
- variant: "glass",
6213
- header: { title: labels.step3Title, subtitle: labels.step3Subtitle },
6214
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6215
- /* @__PURE__ */ jsxs(FormGrid, { children: [
6216
- showRegion && (preset.regions ? /* @__PURE__ */ jsx(
6217
- FormSelect,
6218
- {
6219
- label: labels.regionLabel,
6220
- value: region,
6221
- onValueChange: (v) => {
6222
- setRegion(v);
6223
- markTouched();
6224
- },
6225
- options: [...preset.regions]
6226
- }
6227
- ) : /* @__PURE__ */ jsx(
6228
- FormInput,
6229
- {
6230
- label: labels.regionLabel,
6231
- value: region,
6232
- onValueChange: (v) => {
6233
- setRegion(v);
6234
- markTouched();
6235
- },
6236
- placeholder: labels.regionPlaceholder ?? preset.defaultRegion
6237
- }
6238
- )),
6239
- showEndpoint && /* @__PURE__ */ jsx(
6240
- FormInput,
6241
- {
6242
- label: labels.endpointLabel,
6243
- type: "url",
6244
- value: endpoint,
6245
- onValueChange: (v) => {
6246
- setEndpoint(v);
6247
- markTouched();
6248
- },
6249
- placeholder: labels.endpointPlaceholder ?? "https://\u2026"
6250
- }
6251
- )
6252
- ] }),
6253
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
6254
- /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.modelFilterLabel }),
6255
- /* @__PURE__ */ jsx(
6256
- ChipPicker,
6257
- {
6258
- items: modelFilterItems,
6259
- selectedIds: modelFilterSelected,
6260
- onChange: (ids) => {
6261
- setModelFilterSelected(ids);
6262
- markTouched();
6263
- },
6264
- onItemsChange: (items) => {
6265
- setModelFilterItems(items);
6266
- markTouched();
6267
- },
6268
- allowCustom: true,
6269
- showActions: false,
6270
- addPlaceholder: labels.modelFilterPlaceholder,
6271
- addAriaLabel: labels.modelFilterLabel
6272
- }
6273
- )
6274
- ] }),
6275
- onTestConnection && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
6276
- /* @__PURE__ */ jsx(
6277
- Button,
6278
- {
6279
- type: "button",
6280
- outline: true,
6281
- onClick: () => void handleTestConnection(),
6282
- disabled: testStatus === "testing",
6283
- children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
6284
- /* @__PURE__ */ jsx(Spinner, { size: "xs" }),
6285
- labels.testing
6286
- ] }) : labels.testConnection
6287
- }
6288
- ),
6289
- testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
6290
- testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
6291
- ] })
6292
- ] })
6293
- }
6294
- );
6076
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6077
+ /* @__PURE__ */ jsxs(FormGrid, { children: [
6078
+ showRegion && (preset.regions ? /* @__PURE__ */ jsx(
6079
+ FormSelect,
6080
+ {
6081
+ label: labels.regionLabel,
6082
+ value: region,
6083
+ onValueChange: (v) => {
6084
+ setRegion(v);
6085
+ markTouched();
6086
+ },
6087
+ options: [...preset.regions]
6088
+ }
6089
+ ) : /* @__PURE__ */ jsx(
6090
+ FormInput,
6091
+ {
6092
+ label: labels.regionLabel,
6093
+ value: region,
6094
+ onValueChange: (v) => {
6095
+ setRegion(v);
6096
+ markTouched();
6097
+ },
6098
+ placeholder: labels.regionPlaceholder ?? preset.defaultRegion
6099
+ }
6100
+ )),
6101
+ showEndpoint && /* @__PURE__ */ jsx(
6102
+ FormInput,
6103
+ {
6104
+ label: labels.endpointLabel,
6105
+ type: "url",
6106
+ value: endpoint,
6107
+ onValueChange: (v) => {
6108
+ setEndpoint(v);
6109
+ markTouched();
6110
+ },
6111
+ placeholder: labels.endpointPlaceholder ?? "https://\u2026"
6112
+ }
6113
+ )
6114
+ ] }),
6115
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
6116
+ /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.modelFilterLabel }),
6117
+ /* @__PURE__ */ jsx(
6118
+ ChipPicker,
6119
+ {
6120
+ items: modelFilterItems,
6121
+ selectedIds: modelFilterSelected,
6122
+ onChange: (ids) => {
6123
+ setModelFilterSelected(ids);
6124
+ markTouched();
6125
+ },
6126
+ onItemsChange: (items) => {
6127
+ setModelFilterItems(items);
6128
+ markTouched();
6129
+ },
6130
+ allowCustom: true,
6131
+ showActions: false,
6132
+ addPlaceholder: labels.modelFilterPlaceholder,
6133
+ addAriaLabel: labels.modelFilterLabel
6134
+ }
6135
+ )
6136
+ ] }),
6137
+ onTestConnection && /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
6138
+ /* @__PURE__ */ jsx(
6139
+ Button,
6140
+ {
6141
+ type: "button",
6142
+ outline: true,
6143
+ onClick: () => void handleTestConnection(),
6144
+ disabled: testStatus === "testing",
6145
+ children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
6146
+ /* @__PURE__ */ jsx(Spinner, { size: "xs" }),
6147
+ labels.testing
6148
+ ] }) : labels.testConnection
6149
+ }
6150
+ ),
6151
+ testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
6152
+ testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
6153
+ ] })
6154
+ ] });
6295
6155
  }
6296
6156
  function renderStep4() {
6297
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6157
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
6298
6158
  /* @__PURE__ */ jsx(
6299
- SectionCard,
6159
+ ReviewBlock4,
6300
6160
  {
6301
- variant: "glass",
6302
- header: { title: labels.step1Title, subtitle: labels.step1Subtitle },
6303
- actions: /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: labels.wizardReviewEdit }),
6161
+ stepTitle: labels.step1Title,
6162
+ stepSubtitle: labels.step1Subtitle,
6163
+ editLabel: labels.wizardReviewEdit,
6164
+ onEdit: () => goToStep(1),
6304
6165
  children: /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewProviderLabel, value: preset.label }) })
6305
6166
  }
6306
6167
  ),
6307
6168
  /* @__PURE__ */ jsx(
6308
- SectionCard,
6169
+ ReviewBlock4,
6309
6170
  {
6310
- variant: "glass",
6311
- header: { title: labels.step2Title, subtitle: labels.step2Subtitle },
6312
- actions: /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: labels.wizardReviewEdit }),
6171
+ stepTitle: labels.step2Title,
6172
+ stepSubtitle: labels.step2Subtitle,
6173
+ editLabel: labels.wizardReviewEdit,
6174
+ onEdit: () => goToStep(2),
6313
6175
  children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
6314
6176
  /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
6315
6177
  /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewApiKeyLabel, value: apiKey ? labels.reviewApiKeyRedacted : labels.reviewNoneValue })
@@ -6317,11 +6179,12 @@ function ModelNewWizardPageView({
6317
6179
  }
6318
6180
  ),
6319
6181
  /* @__PURE__ */ jsx(
6320
- SectionCard,
6182
+ ReviewBlock4,
6321
6183
  {
6322
- variant: "glass",
6323
- header: { title: labels.step3Title, subtitle: labels.step3Subtitle },
6324
- actions: /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: labels.wizardReviewEdit }),
6184
+ stepTitle: labels.step3Title,
6185
+ stepSubtitle: labels.step3Subtitle,
6186
+ editLabel: labels.wizardReviewEdit,
6187
+ onEdit: () => goToStep(3),
6325
6188
  children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
6326
6189
  /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewRegionLabel, value: region || labels.reviewNoneValue }),
6327
6190
  /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewEndpointLabel, value: endpoint || labels.reviewNoneValue }),
@@ -6339,14 +6202,14 @@ function ModelNewWizardPageView({
6339
6202
  }
6340
6203
  const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
6341
6204
  const advanceDisabled = !canAdvance(step);
6342
- const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
6343
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
6344
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6345
- /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
6346
- step < TOTAL_STEPS4 ? /* @__PURE__ */ jsx(Button, { type: "button", color: "emerald", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "emerald", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate })
6347
- ] })
6205
+ const isLast = step === TOTAL_STEPS4;
6206
+ const scrollableStep = step === 1 || step === 4;
6207
+ const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
6208
+ const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
6209
+ /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
6210
+ isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
6348
6211
  ] });
6349
- const content = /* @__PURE__ */ jsxs(
6212
+ return /* @__PURE__ */ jsxs(
6350
6213
  "form",
6351
6214
  {
6352
6215
  onSubmit: (e) => {
@@ -6356,15 +6219,12 @@ function ModelNewWizardPageView({
6356
6219
  },
6357
6220
  className: "space-y-4",
6358
6221
  children: [
6359
- /* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
6222
+ hero,
6223
+ /* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
6360
6224
  footer
6361
6225
  ]
6362
6226
  }
6363
6227
  );
6364
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6365
- hero,
6366
- content
6367
- ] });
6368
6228
  }
6369
6229
  function ReviewRow4({ label, value }) {
6370
6230
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
@@ -6372,6 +6232,27 @@ function ReviewRow4({ label, value }) {
6372
6232
  /* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
6373
6233
  ] });
6374
6234
  }
6235
+ function ReviewBlock4({
6236
+ stepTitle,
6237
+ stepSubtitle,
6238
+ editLabel,
6239
+ onEdit,
6240
+ children
6241
+ }) {
6242
+ return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
6243
+ /* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
6244
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
6245
+ /* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
6246
+ stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
6247
+ ] }),
6248
+ /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
6249
+ /* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
6250
+ /* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
6251
+ ] })
6252
+ ] }),
6253
+ children
6254
+ ] });
6255
+ }
6375
6256
  function ModelNewModal({ open, onClose, ...wizardProps }) {
6376
6257
  return /* @__PURE__ */ jsx(
6377
6258
  GlassModal,