@emeraldemperaur/vector-sigma 1.4.21 → 1.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -48800,6 +48800,40 @@ const CodexItem = ({ stepId, children, }) => {
48800
48800
  return (React.createElement("div", { className: "v-step-content-animation", style: { width: '100%' } }, children));
48801
48801
  };
48802
48802
 
48803
+ const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onNext, onPrev, onFinish }) => {
48804
+ const { setActiveStepId } = useStepper();
48805
+ const handlePrev = () => {
48806
+ if (onPrev)
48807
+ onPrev();
48808
+ if (prevStepId)
48809
+ setActiveStepId(prevStepId);
48810
+ };
48811
+ const handleNext = () => {
48812
+ if (nextStepId) {
48813
+ if (onNext)
48814
+ onNext();
48815
+ setActiveStepId(nextStepId);
48816
+ }
48817
+ else {
48818
+ if (onFinish)
48819
+ onFinish();
48820
+ }
48821
+ };
48822
+ return (React.createElement(p$5, { gap: "3", mt: "6", justify: "between", align: "center", style: { borderTop: '1px solid var(--gray-5)', paddingTop: '20px', width: '100%' } },
48823
+ prevStepId ? (React.createElement(o$a, { variant: "soft", color: "gray", onClick: handlePrev, style: { cursor: 'pointer' } },
48824
+ prevIcon ? React.createElement(React.Fragment, null,
48825
+ React.createElement(Icon, { name: prevIcon }),
48826
+ "\u00A0") : null,
48827
+ prevLabel)) : (React.createElement("div", null)),
48828
+ React.createElement(o$a, { variant: "solid", color: nextStepId ? "blue" : "green", onClick: handleNext, style: { cursor: 'pointer' } },
48829
+ nextStepId && nextIcon ? React.createElement(React.Fragment, null,
48830
+ React.createElement(Icon, { name: nextIcon }),
48831
+ "\u00A0") : React.createElement(React.Fragment, null,
48832
+ React.createElement(Icon, { name: finishIcon }),
48833
+ "\u00A0"),
48834
+ nextStepId ? nextLabel : finishLabel)));
48835
+ };
48836
+
48803
48837
  /** A special constant with type `never` */
48804
48838
  function $constructor(name, initializer, params) {
48805
48839
  function init(inst, def) {
@@ -53322,6 +53356,7 @@ exports.ButtonInput = ButtonInput;
53322
53356
  exports.CURRENCIES = CURRENCIES;
53323
53357
  exports.CheckboxGroupInput = CheckboxGroupInput;
53324
53358
  exports.Codex = Codex;
53359
+ exports.CodexControls = CodexControls;
53325
53360
  exports.CodexItem = CodexItem;
53326
53361
  exports.Column = Column;
53327
53362
  exports.ConditionalTrigger = ConditionalTrigger;
package/lib/index.esm.js CHANGED
@@ -48780,6 +48780,40 @@ const CodexItem = ({ stepId, children, }) => {
48780
48780
  return (React__default.createElement("div", { className: "v-step-content-animation", style: { width: '100%' } }, children));
48781
48781
  };
48782
48782
 
48783
+ const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onNext, onPrev, onFinish }) => {
48784
+ const { setActiveStepId } = useStepper();
48785
+ const handlePrev = () => {
48786
+ if (onPrev)
48787
+ onPrev();
48788
+ if (prevStepId)
48789
+ setActiveStepId(prevStepId);
48790
+ };
48791
+ const handleNext = () => {
48792
+ if (nextStepId) {
48793
+ if (onNext)
48794
+ onNext();
48795
+ setActiveStepId(nextStepId);
48796
+ }
48797
+ else {
48798
+ if (onFinish)
48799
+ onFinish();
48800
+ }
48801
+ };
48802
+ return (React__default.createElement(p$5, { gap: "3", mt: "6", justify: "between", align: "center", style: { borderTop: '1px solid var(--gray-5)', paddingTop: '20px', width: '100%' } },
48803
+ prevStepId ? (React__default.createElement(o$a, { variant: "soft", color: "gray", onClick: handlePrev, style: { cursor: 'pointer' } },
48804
+ prevIcon ? React__default.createElement(React__default.Fragment, null,
48805
+ React__default.createElement(Icon, { name: prevIcon }),
48806
+ "\u00A0") : null,
48807
+ prevLabel)) : (React__default.createElement("div", null)),
48808
+ React__default.createElement(o$a, { variant: "solid", color: nextStepId ? "blue" : "green", onClick: handleNext, style: { cursor: 'pointer' } },
48809
+ nextStepId && nextIcon ? React__default.createElement(React__default.Fragment, null,
48810
+ React__default.createElement(Icon, { name: nextIcon }),
48811
+ "\u00A0") : React__default.createElement(React__default.Fragment, null,
48812
+ React__default.createElement(Icon, { name: finishIcon }),
48813
+ "\u00A0"),
48814
+ nextStepId ? nextLabel : finishLabel)));
48815
+ };
48816
+
48783
48817
  /** A special constant with type `never` */
48784
48818
  function $constructor(name, initializer, params) {
48785
48819
  function init(inst, def) {
@@ -53295,4 +53329,4 @@ const parseUuidFormat = (input) => {
53295
53329
  return numbers;
53296
53330
  };
53297
53331
 
53298
- export { Accordion, AccordionItem, AvatarInput, ButtonInput, CURRENCIES, CheckboxGroupInput, Codex, CodexItem, Column, ConditionalTrigger, Container, CreditCardInput, CurrencyInput, DatePicker, DateRangePicker, DateTimePicker, Dropdown, File$1 as File, FileMultiple, FlagIcon, Icon, ImageOutput, Input$2 as Input, MultipleSelect, OptionSelect, PasswordInput, PhoneInput, RadioGroupInput, RangeSlider, Row, SectionTitle, SliderInput, StockInput, R as Theme, N as ThemePanel, Toggle, UUIDInput, parseUuidFormat, primeMatrix, useStepper, vectorSigma, xFormSchema };
53332
+ export { Accordion, AccordionItem, AvatarInput, ButtonInput, CURRENCIES, CheckboxGroupInput, Codex, CodexControls, CodexItem, Column, ConditionalTrigger, Container, CreditCardInput, CurrencyInput, DatePicker, DateRangePicker, DateTimePicker, Dropdown, File$1 as File, FileMultiple, FlagIcon, Icon, ImageOutput, Input$2 as Input, MultipleSelect, OptionSelect, PasswordInput, PhoneInput, RadioGroupInput, RangeSlider, Row, SectionTitle, SliderInput, StockInput, R as Theme, N as ThemePanel, Toggle, UUIDInput, parseUuidFormat, primeMatrix, useStepper, vectorSigma, xFormSchema };
@@ -33,6 +33,7 @@ export * from './layouts/column/column';
33
33
  export * from './layouts/row/row';
34
34
  export * from './layouts/accordion/accordion';
35
35
  export * from './layouts/codex/codex';
36
+ export * from './layouts/codex/codexcontrols';
36
37
  export * from './utils/architect';
37
38
  export * from './utils/uuidparser';
38
39
  export * from './utils/currencyconfig';
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import '../../styles/main.scss';
3
+ export interface CodexControlsProps {
4
+ /**
5
+ * * The ID of the step to navigate to when 'Next' is clicked.
6
+ * If omitted, the primary button becomes a 'Finish' button.
7
+ * * @example
8
+ * nextStepId="step-3"
9
+ */
10
+ nextStepId?: string;
11
+ /**
12
+ * * The ID of the step to navigate to when 'Back' is clicked.
13
+ * If omitted, the 'Back' button is hidden.
14
+ * * @example
15
+ * prevStepId="step-1"
16
+ */
17
+ prevStepId?: string;
18
+ /**
19
+ * * Custom text for the Next button.
20
+ * Default: "Continue"
21
+ */
22
+ nextLabel?: string;
23
+ /**
24
+ * * Custom icon for the Next button.
25
+ * Default: "Continue"
26
+ */
27
+ nextIcon?: string;
28
+ /**
29
+ * * Custom text for the Previous button.
30
+ * Default: "Back"
31
+ */
32
+ prevLabel?: string;
33
+ /**
34
+ * * Custom icon name for the Previous button.
35
+ * Default: "Back"
36
+ */
37
+ prevIcon?: string;
38
+ /**
39
+ * * Custom text for the Finish button (rendered when nextStepId undefined).
40
+ * Default: "Complete Setup"
41
+ */
42
+ finishLabel?: string;
43
+ /**
44
+ * * Custom icon name for the Finish button (rendered when no nextStepId undefined).
45
+ * Default: "flag"
46
+ */
47
+ finishIcon?: string;
48
+ /**
49
+ * * Optional callback triggered before navigating to the next step.
50
+ * Useful for triggering form validation.
51
+ */
52
+ onNext?: () => void;
53
+ /**
54
+ * * Optional callback triggered before navigating to the previous step.
55
+ */
56
+ onPrev?: () => void;
57
+ /**
58
+ * * Optional callback triggered when the Finish button is clicked.
59
+ */
60
+ onFinish?: () => void;
61
+ }
62
+ export declare const CodexControls: ({ nextStepId, prevStepId, nextLabel, prevLabel, finishLabel, prevIcon, nextIcon, finishIcon, onNext, onPrev, onFinish }: CodexControlsProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeraldemperaur/vector-sigma",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "Dynamic Form Orchestrator: NPM Package",
5
5
  "repository": {
6
6
  "type": "git",