@emeraldemperaur/vector-sigma 1.4.46 → 1.4.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -343,19 +343,28 @@ import { useVectorSigma } from './hooks/useVectorSigma';
343
343
 
344
344
  <li><strong>🎨Theming Extensibilty</strong></br>
345
345
  <p align="justify">Customizable to fit seamlessly into an existing design system and allow developer control of the visual layer through standard CSS patterns.</p>
346
+ <p>Radix UI <code>theme</code> {} passed into the <code>transfrom()</code> or <code>render()</code> method(s) as an <code>options</code> attribute can be leveraged to cleverly align the returned xForm style and appearance with an extant application design system.</p>
346
347
 
347
348
  ```javascript
348
- import { Theme, File, Dropdown } from '@emeraldemperaur/vector-sigma';
349
+ import React from 'react';
350
+ import { VectorSigma } from './VectorSigma';
349
351
 
350
- const App = () => {
351
- return (
352
-
353
- <Theme>
354
- <File/>
355
- <Dropdown/>
356
- </Theme>
357
- );
358
- }
352
+ const xForm97 = new VectorSigma(apiJSONData);
353
+
354
+ return xForm97.render({
355
+ displayMode: 'codex',
356
+ // www.radix-ui.com/themes/docs/components/theme
357
+ theme: {
358
+ appearance: 'dark',
359
+ accentColor: 'yellow',
360
+ grayColor: 'slate',
361
+ radius: 'none',
362
+ scaling: '100%'
363
+ },
364
+ onSubmit: async (values, actions, instance) => {
365
+ console.log(values);
366
+ }
367
+ });
359
368
  ```
360
369
  </li>
361
370
 
package/lib/index.cjs CHANGED
@@ -32049,9 +32049,9 @@ const getStyles = (design, layout) => {
32049
32049
  const ImageOutput = ({ id, src, alt = "Image", design = 'outline', layout = 'normal', aspectratio = 16 / 9, height, width = '100%', className, style, onClick, }) => {
32050
32050
  const containerStyles = getStyles(design, layout);
32051
32051
  const iconColor = design === 'neumorphic' ? '#555' : 'var(--gray-9)';
32052
- const content = (React.createElement(p$8, { className: className, style: Object.assign(Object.assign(Object.assign({}, containerStyles), { width, height: height || 'auto' }), style), onClick: onClick }, src ? (React.createElement("img", { id: String(id), src: src, alt: alt, style: {
32053
- width: '333px',
32054
- height: '333px',
32052
+ const content = (React.createElement(p$8, { className: className, style: Object.assign(Object.assign(Object.assign({}, containerStyles), { width: '100%', height: height || '100%' }), style), onClick: onClick }, src ? (React.createElement("img", { id: String(id), src: src, alt: alt, style: {
32053
+ width: '100%',
32054
+ height: '100%',
32055
32055
  objectFit: 'cover',
32056
32056
  display: 'block',
32057
32057
  } })) : (React.createElement(p$5, { align: "center", justify: "center", style: {
@@ -32063,11 +32063,7 @@ const ImageOutput = ({ id, src, alt = "Image", design = 'outline', layout = 'nor
32063
32063
  React.createElement(p$5, { direction: "column", align: "center", gap: "2" },
32064
32064
  React.createElement(Icon, { name: 'image', width: "32", height: "32", color: iconColor, style: { opacity: 0.5 } }),
32065
32065
  React.createElement(p$d, { size: "1", color: "gray" }, "No Image"))))));
32066
- if (height) {
32067
- return content;
32068
- }
32069
- return (React.createElement(p$8, { style: { width } },
32070
- React.createElement(i$9, { ratio: aspectratio }, content)));
32066
+ return (React.createElement(p$8, { style: { width, maxWidth: 500, maxHeight: 500 } }, height ? (content) : (React.createElement(i$9, { ratio: aspectratio }, content))));
32071
32067
  };
32072
32068
 
32073
32069
  const Input$1 = (_a) => {
@@ -57273,7 +57269,7 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
57273
57269
  case 'codex':
57274
57270
  return (React.createElement(Codex, { brandColor: brandColor }, xFormModel.model.map((formsection, index, array) => (React.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title, subtitleDescription: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57275
57271
  React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
57276
- React.createElement(CodexControls, { prevStepId: index > 0 ? String(array[index - 1].sectionId) : undefined, nextStepId: index < array.length - 1 ? String(array[index + 1].sectionId) : undefined, onPrev: onPrev, onNext: onNext, onFinish: onFinish }))))));
57272
+ React.createElement(CodexControls, { prevStepId: index > 0 ? String(array[index - 1].sectionId) : undefined, nextStepId: index < array.length - 1 ? String(array[index + 1].sectionId) : undefined, onPrev: onPrev, onNext: onNext, onFinish: () => onFinish }))))));
57277
57273
  case 'codice':
57278
57274
  default:
57279
57275
  return (React.createElement(React.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
@@ -57587,7 +57583,8 @@ class VectorSigma {
57587
57583
  const sanitizedData = normalizeXForm(this.formObject);
57588
57584
  const { initialValues, validationSchema } = this.buildFormikConfig(sanitizedData);
57589
57585
  const isCodexMode = (options === null || options === void 0 ? void 0 : options.displayMode) === 'codex';
57590
- return (React.createElement(R, null,
57586
+ const themeConfig = Object.assign({ appearance: 'inherit', accentColor: 'blue', radius: 'medium' }, options === null || options === void 0 ? void 0 : options.theme);
57587
+ return (React.createElement(R, Object.assign({}, themeConfig),
57591
57588
  React.createElement(formik.Formik, { initialValues: initialValues, validationSchema: validationSchema, onSubmit: (values, actions) => __awaiter(this, void 0, void 0, function* () {
57592
57589
  try {
57593
57590
  this.statusCode = 2;
@@ -57598,7 +57595,7 @@ class VectorSigma {
57598
57595
  yield options.onSubmit(values, actions, this);
57599
57596
  }
57600
57597
  if (options === null || options === void 0 ? void 0 : options.onFinish) {
57601
- options.onFinish();
57598
+ options.onFinish(values, actions, this);
57602
57599
  }
57603
57600
  }
57604
57601
  catch (error) {
package/lib/index.esm.js CHANGED
@@ -32028,9 +32028,9 @@ const getStyles = (design, layout) => {
32028
32028
  const ImageOutput = ({ id, src, alt = "Image", design = 'outline', layout = 'normal', aspectratio = 16 / 9, height, width = '100%', className, style, onClick, }) => {
32029
32029
  const containerStyles = getStyles(design, layout);
32030
32030
  const iconColor = design === 'neumorphic' ? '#555' : 'var(--gray-9)';
32031
- const content = (React__default.createElement(p$8, { className: className, style: Object.assign(Object.assign(Object.assign({}, containerStyles), { width, height: height || 'auto' }), style), onClick: onClick }, src ? (React__default.createElement("img", { id: String(id), src: src, alt: alt, style: {
32032
- width: '333px',
32033
- height: '333px',
32031
+ const content = (React__default.createElement(p$8, { className: className, style: Object.assign(Object.assign(Object.assign({}, containerStyles), { width: '100%', height: height || '100%' }), style), onClick: onClick }, src ? (React__default.createElement("img", { id: String(id), src: src, alt: alt, style: {
32032
+ width: '100%',
32033
+ height: '100%',
32034
32034
  objectFit: 'cover',
32035
32035
  display: 'block',
32036
32036
  } })) : (React__default.createElement(p$5, { align: "center", justify: "center", style: {
@@ -32042,11 +32042,7 @@ const ImageOutput = ({ id, src, alt = "Image", design = 'outline', layout = 'nor
32042
32042
  React__default.createElement(p$5, { direction: "column", align: "center", gap: "2" },
32043
32043
  React__default.createElement(Icon, { name: 'image', width: "32", height: "32", color: iconColor, style: { opacity: 0.5 } }),
32044
32044
  React__default.createElement(p$d, { size: "1", color: "gray" }, "No Image"))))));
32045
- if (height) {
32046
- return content;
32047
- }
32048
- return (React__default.createElement(p$8, { style: { width } },
32049
- React__default.createElement(i$9, { ratio: aspectratio }, content)));
32045
+ return (React__default.createElement(p$8, { style: { width, maxWidth: 500, maxHeight: 500 } }, height ? (content) : (React__default.createElement(i$9, { ratio: aspectratio }, content))));
32050
32046
  };
32051
32047
 
32052
32048
  const Input$1 = (_a) => {
@@ -57252,7 +57248,7 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
57252
57248
  case 'codex':
57253
57249
  return (React__default.createElement(Codex, { brandColor: brandColor }, xFormModel.model.map((formsection, index, array) => (React__default.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title, subtitleDescription: formsection.subtitle ? formsection.subtitle : undefined, icon: React__default.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57254
57250
  React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
57255
- React__default.createElement(CodexControls, { prevStepId: index > 0 ? String(array[index - 1].sectionId) : undefined, nextStepId: index < array.length - 1 ? String(array[index + 1].sectionId) : undefined, onPrev: onPrev, onNext: onNext, onFinish: onFinish }))))));
57251
+ React__default.createElement(CodexControls, { prevStepId: index > 0 ? String(array[index - 1].sectionId) : undefined, nextStepId: index < array.length - 1 ? String(array[index + 1].sectionId) : undefined, onPrev: onPrev, onNext: onNext, onFinish: () => onFinish }))))));
57256
57252
  case 'codice':
57257
57253
  default:
57258
57254
  return (React__default.createElement(React__default.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React__default.createElement(React__default.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
@@ -57566,7 +57562,8 @@ class VectorSigma {
57566
57562
  const sanitizedData = normalizeXForm(this.formObject);
57567
57563
  const { initialValues, validationSchema } = this.buildFormikConfig(sanitizedData);
57568
57564
  const isCodexMode = (options === null || options === void 0 ? void 0 : options.displayMode) === 'codex';
57569
- return (React__default.createElement(R, null,
57565
+ const themeConfig = Object.assign({ appearance: 'inherit', accentColor: 'blue', radius: 'medium' }, options === null || options === void 0 ? void 0 : options.theme);
57566
+ return (React__default.createElement(R, Object.assign({}, themeConfig),
57570
57567
  React__default.createElement(Formik, { initialValues: initialValues, validationSchema: validationSchema, onSubmit: (values, actions) => __awaiter(this, void 0, void 0, function* () {
57571
57568
  try {
57572
57569
  this.statusCode = 2;
@@ -57577,7 +57574,7 @@ class VectorSigma {
57577
57574
  yield options.onSubmit(values, actions, this);
57578
57575
  }
57579
57576
  if (options === null || options === void 0 ? void 0 : options.onFinish) {
57580
- options.onFinish();
57577
+ options.onFinish(values, actions, this);
57581
57578
  }
57582
57579
  }
57583
57580
  catch (error) {
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { XFormType } from 'utils/voltron';
3
+ import { FormikHelpers } from 'formik';
4
+ import { VectorSigma } from 'vectorSigma';
3
5
  export type teletraan1Display = 'accordion' | 'codice' | 'codex' | 'dual';
4
6
  export interface Teletraan1Props {
5
7
  /**
@@ -49,6 +51,6 @@ export interface Teletraan1Props {
49
51
  * * @example
50
52
  * onFinish={console.log("Teletraan-1 Codex :: onFinish()")}
51
53
  */
52
- onFinish?: () => void;
54
+ onFinish?: (values: any, actions: FormikHelpers<any>, instance: VectorSigma<any>) => void | Promise<any>;
53
55
  }
54
56
  export declare const Teletraan1: ({ xFormModel, readOnlyMode, displayMode, brandColor, onPrev, onNext, onFinish }: Teletraan1Props) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { XFormType, XFormQuery, SectionSchema } from './utils/voltron';
3
3
  import { Teletraan1Props } from './teletraan1';
4
4
  import { z } from "zod";
5
+ import { ThemeProps } from '@radix-ui/themes';
5
6
  import { FormikHelpers } from 'formik';
6
7
  import './styles/main.scss';
7
8
  export interface VectorSigmaRenderProps<T extends Record<string, any> = Record<string, any>> extends Omit<Teletraan1Props, 'xFormModel'> {
@@ -20,6 +21,15 @@ export interface VectorSigmaRenderProps<T extends Record<string, any> = Record<s
20
21
  }}
21
22
  */
22
23
  onSubmit?: (values: T, actions: FormikHelpers<T>, instance: VectorSigma<T>) => void | Promise<any>;
24
+ /**
25
+ * * Optional Radix UI Theme configuration.
26
+ * Enables developer theming extensibility to align xForm appearance with an extant application design system.
27
+ *
28
+ * https://www.radix-ui.com/themes/docs/components/theme
29
+ * @example
30
+ * theme={{ appearance: 'dark', accentColor: 'ruby', radius: 'large' }}
31
+ */
32
+ theme?: Omit<ThemeProps, 'children'>;
23
33
  }
24
34
  export declare class VectorSigma<T extends Record<string, any> = Record<string, any>> {
25
35
  isValid: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeraldemperaur/vector-sigma",
3
- "version": "1.4.46",
3
+ "version": "1.4.47",
4
4
  "description": "Dynamic Form Orchestrator: NPM Package",
5
5
  "repository": {
6
6
  "type": "git",
File without changes
File without changes