@tiendanube/nube-sdk-ui 0.1.3-alpha → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# `@tiendanube/nube-sdk-ui`
|
|
2
|
+
|
|
3
|
+
**Library for building declarative UI components in NubeSDK.**
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
`@tiendanube/nube-sdk-ui` provides **a set of functions** to create UI components declaratively within **NubeSDK**. This package allows developers to define UI components as structured objects, ensuring that UI components are safely structured and passed to the platform for rendering.
|
|
8
|
+
|
|
9
|
+
This package follows a **declarative approach**, where UI is described as data instead of imperative code. These structured objects are later interpreted by the platform to generate the final UI.
|
|
10
|
+
|
|
11
|
+
Apps in NubeSDK run **inside isolated web workers**, without direct access to the DOM. This ensures security, consistency, and predictable rendering behavior.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install @tiendanube/nube-sdk-ui @tiendanube/nube-sdk-types
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> Note: `@tiendanube/nube-sdk-types` is a peer dependency and must be installed alongside this package.
|
|
20
|
+
|
|
21
|
+
## Main Components
|
|
22
|
+
|
|
23
|
+
This package provides utility functions for creating UI components in **NubeSDK**, including:
|
|
24
|
+
|
|
25
|
+
### Layout Components
|
|
26
|
+
- `box` → Creates a flexible container for structuring layouts.
|
|
27
|
+
- `col` → Defines a column layout inside a row or another container.
|
|
28
|
+
- `row` → Defines a horizontal layout with flexible positioning.
|
|
29
|
+
|
|
30
|
+
### Interactive Components
|
|
31
|
+
- `field` → Represents an input element such as text fields, dropdowns, or checkboxes.
|
|
32
|
+
|
|
33
|
+
### Visual Components
|
|
34
|
+
- `img` → Displays an image with support for responsive sources.
|
|
35
|
+
- `txt` → Renders text with optional formatting.
|
|
36
|
+
|
|
37
|
+
### Structural Components
|
|
38
|
+
- `fragment` → Groups multiple components without introducing an additional structural wrapper.
|
|
39
|
+
|
|
40
|
+
## Example Usage
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { box, col, row, field, img, txt, fragment } from "@tiendanube/nube-sdk-ui";
|
|
44
|
+
|
|
45
|
+
const componentTree = box({
|
|
46
|
+
children: [
|
|
47
|
+
row({
|
|
48
|
+
children: [
|
|
49
|
+
col({ children: txt({ children: "Hello, NubeSDK!" }) }),
|
|
50
|
+
],
|
|
51
|
+
}),
|
|
52
|
+
field({ name: "email", label: "Email" })
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Example Project Setup
|
|
58
|
+
|
|
59
|
+
A minimal example project using `@tiendanube/nube-sdk-ui` is available in the repository under:
|
|
60
|
+
|
|
61
|
+
- [`examples/minimal-ui`](https://github.com/TiendaNube/nube-sdk/tree/main/examples/minimal-ui)
|
|
62
|
+
|
|
63
|
+
This example include **pre-configured build setups**, ensuring a seamless development experience.
|
|
64
|
+
|
|
65
|
+
## Official Documentation
|
|
66
|
+
|
|
67
|
+
For more details about NubeSDK and how to build apps, check out our **official documentation**:
|
|
68
|
+
|
|
69
|
+
[**NubeSDK Documentation**](https://dev.tiendanube.com/docs/applications/nube-sdk/overview)
|
|
70
|
+
|
|
71
|
+
## Support
|
|
72
|
+
|
|
73
|
+
- **Questions?** Use [GitHub Issues](https://github.com/TiendaNube/nube-sdk/issues).
|
|
74
|
+
- **Found a bug?** Open an issue with a reproducible example.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
© [Tiendanube / Nuvemshop](https://www.tiendanube.com), 2025. All rights reserved.
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/box.ts","../src/components/col.ts","../src/components/row.ts","../src/components/field.ts","../src/components/fragment.ts","../src/components/img.ts","../src/components/txt.ts"],"sourcesContent":["export * from \"./components/box\";\nexport * from \"./components/col\";\nexport * from \"./components/row\";\nexport * from \"./components/field\";\nexport * from \"./components/fragment\";\nexport * from \"./components/img\";\nexport * from \"./components/txt\";\n","import type {\n\tNubeComponentBox,\n\tNubeComponentBoxProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const box = (props: NubeComponentBoxProps): NubeComponentBox => ({\n\ttype: \"box\",\n\t...props,\n});\n","import type {\n\tNubeComponentCol,\n\tNubeComponentColProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const col = (props: NubeComponentColProps): NubeComponentCol => ({\n\ttype: \"col\",\n\t...props,\n});\n","import type {\n\tNubeComponentRow,\n\tNubeComponentRowProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const row = (props: NubeComponentRowProps): NubeComponentRow => ({\n\ttype: \"row\",\n\t...props,\n});\n","import type {\n\tNubeComponentField,\n\tNubeComponentFieldProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const field = (props: NubeComponentFieldProps): NubeComponentField => ({\n\ttype: \"field\",\n\t...props,\n});\n","import type {\n\tNubeComponentFragment,\n\tNubeComponentFragmentProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const fragment = (\n\tprops: NubeComponentFragmentProps,\n): NubeComponentFragment => ({\n\ttype: \"fragment\",\n\t...props,\n});\n","import type {\n\tNubeComponentImg,\n\tNubeComponentImgProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const img = (props: NubeComponentImgProps): NubeComponentImg => ({\n\ttype: \"img\",\n\t...props,\n});\n","import type {\n\tNubeComponentTxt,\n\tNubeComponentTxtProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const txt = (props: NubeComponentTxtProps): NubeComponentTxt => ({\n\ttype: \"txt\",\n\t...props,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/box.ts","../src/components/col.ts","../src/components/row.ts","../src/components/field.ts","../src/components/fragment.ts","../src/components/img.ts","../src/components/txt.ts"],"sourcesContent":["export * from \"./components/box\";\nexport * from \"./components/col\";\nexport * from \"./components/row\";\nexport * from \"./components/field\";\nexport * from \"./components/fragment\";\nexport * from \"./components/img\";\nexport * from \"./components/txt\";\n","import type {\n\tNubeComponentBox,\n\tNubeComponentBoxProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `box` component.\n *\n * A `box` is a flexible container that can be used for layout purposes.\n * It supports properties like width, height, padding, margin, and flex-based alignment.\n *\n * @param props - The properties for configuring the box component.\n * @returns A `NubeComponentBox` object representing the box component.\n */\nexport const box = (props: NubeComponentBoxProps): NubeComponentBox => ({\n\ttype: \"box\",\n\t...props,\n});\n","import type {\n\tNubeComponentCol,\n\tNubeComponentColProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `col` (column) component.\n *\n * A `col` is a flexible column container that can be used for structuring layouts.\n * It inherits most properties from `box`, except for the `direction` property.\n *\n * @param props - The properties for configuring the column component.\n * @returns A `NubeComponentCol` object representing the column component.\n */\nexport const col = (props: NubeComponentColProps): NubeComponentCol => ({\n\ttype: \"col\",\n\t...props,\n});\n","import type {\n\tNubeComponentRow,\n\tNubeComponentRowProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `row` component.\n *\n * A `row` is a flexible container used for structuring layouts in a horizontal direction.\n * It inherits most properties from `box`, except for the `direction` property.\n *\n * @param props - The properties for configuring the row component.\n * @returns A `NubeComponentRow` object representing the row component.\n */\nexport const row = (props: NubeComponentRowProps): NubeComponentRow => ({\n\ttype: \"row\",\n\t...props,\n});\n","import type {\n\tNubeComponentField,\n\tNubeComponentFieldProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `field` component.\n *\n * A `field` represents an input element in a form, such as text fields, dropdowns, or checkboxes.\n * It supports properties like `name`, `label`, and event handlers (`onChange`, `onBlur`, `onFocus`).\n *\n * @param props - The properties for configuring the field component.\n * @returns A `NubeComponentField` object representing the form field.\n */\nexport const field = (props: NubeComponentFieldProps): NubeComponentField => ({\n\ttype: \"field\",\n\t...props,\n});\n","import type {\n\tNubeComponentFragment,\n\tNubeComponentFragmentProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `fragment` component.\n *\n * A `fragment` is a logical grouping element that allows multiple children\n * to be wrapped without introducing an additional DOM node.\n *\n * @param props - The properties for configuring the fragment component.\n * @returns A `NubeComponentFragment` object representing the fragment.\n */\nexport const fragment = (\n\tprops: NubeComponentFragmentProps,\n): NubeComponentFragment => ({\n\ttype: \"fragment\",\n\t...props,\n});\n","import type {\n\tNubeComponentImg,\n\tNubeComponentImgProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates an `img` (image) component.\n *\n * The `img` component is used to display images. It supports properties such as\n * `src`, `alt`, `width`, `height`, and responsive `sources` for different screen sizes.\n *\n * @param props - The properties for configuring the image component.\n * @returns A `NubeComponentImg` object representing the image component.\n */\nexport const img = (props: NubeComponentImgProps): NubeComponentImg => ({\n\ttype: \"img\",\n\t...props,\n});\n","import type {\n\tNubeComponentTxt,\n\tNubeComponentTxtProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `txt` (text) component.\n *\n * The `txt` component is used to render text with optional styling.\n * It supports properties such as `color`, `background`, `heading` levels (h1-h6),\n * text formatting `modifiers` (bold, italic, etc.), and inline display.\n *\n * @param props - The properties for configuring the text component.\n * @returns A `NubeComponentTxt` object representing the text component.\n */\nexport const txt = (props: NubeComponentTxtProps): NubeComponentTxt => ({\n\ttype: \"txt\",\n\t...props,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,QAAQ,CAAC,WAAwD;AAAA,EAC7E,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,WAAW,CACvB,WAC4B;AAAA,EAC5B,MAAM;AAAA,EACN,GAAG;AACJ;;;ACLO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACFO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,81 @@
|
|
|
1
1
|
import { NubeComponentBoxProps, NubeComponentBox, NubeComponentColProps, NubeComponentCol, NubeComponentRowProps, NubeComponentRow, NubeComponentFieldProps, NubeComponentField, NubeComponentFragmentProps, NubeComponentFragment, NubeComponentImgProps, NubeComponentImg, NubeComponentTxtProps, NubeComponentTxt } from '@tiendanube/nube-sdk-types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a `box` component.
|
|
5
|
+
*
|
|
6
|
+
* A `box` is a flexible container that can be used for layout purposes.
|
|
7
|
+
* It supports properties like width, height, padding, margin, and flex-based alignment.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The properties for configuring the box component.
|
|
10
|
+
* @returns A `NubeComponentBox` object representing the box component.
|
|
11
|
+
*/
|
|
3
12
|
declare const box: (props: NubeComponentBoxProps) => NubeComponentBox;
|
|
4
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Creates a `col` (column) component.
|
|
16
|
+
*
|
|
17
|
+
* A `col` is a flexible column container that can be used for structuring layouts.
|
|
18
|
+
* It inherits most properties from `box`, except for the `direction` property.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The properties for configuring the column component.
|
|
21
|
+
* @returns A `NubeComponentCol` object representing the column component.
|
|
22
|
+
*/
|
|
5
23
|
declare const col: (props: NubeComponentColProps) => NubeComponentCol;
|
|
6
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Creates a `row` component.
|
|
27
|
+
*
|
|
28
|
+
* A `row` is a flexible container used for structuring layouts in a horizontal direction.
|
|
29
|
+
* It inherits most properties from `box`, except for the `direction` property.
|
|
30
|
+
*
|
|
31
|
+
* @param props - The properties for configuring the row component.
|
|
32
|
+
* @returns A `NubeComponentRow` object representing the row component.
|
|
33
|
+
*/
|
|
7
34
|
declare const row: (props: NubeComponentRowProps) => NubeComponentRow;
|
|
8
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Creates a `field` component.
|
|
38
|
+
*
|
|
39
|
+
* A `field` represents an input element in a form, such as text fields, dropdowns, or checkboxes.
|
|
40
|
+
* It supports properties like `name`, `label`, and event handlers (`onChange`, `onBlur`, `onFocus`).
|
|
41
|
+
*
|
|
42
|
+
* @param props - The properties for configuring the field component.
|
|
43
|
+
* @returns A `NubeComponentField` object representing the form field.
|
|
44
|
+
*/
|
|
9
45
|
declare const field: (props: NubeComponentFieldProps) => NubeComponentField;
|
|
10
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Creates a `fragment` component.
|
|
49
|
+
*
|
|
50
|
+
* A `fragment` is a logical grouping element that allows multiple children
|
|
51
|
+
* to be wrapped without introducing an additional DOM node.
|
|
52
|
+
*
|
|
53
|
+
* @param props - The properties for configuring the fragment component.
|
|
54
|
+
* @returns A `NubeComponentFragment` object representing the fragment.
|
|
55
|
+
*/
|
|
11
56
|
declare const fragment: (props: NubeComponentFragmentProps) => NubeComponentFragment;
|
|
12
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Creates an `img` (image) component.
|
|
60
|
+
*
|
|
61
|
+
* The `img` component is used to display images. It supports properties such as
|
|
62
|
+
* `src`, `alt`, `width`, `height`, and responsive `sources` for different screen sizes.
|
|
63
|
+
*
|
|
64
|
+
* @param props - The properties for configuring the image component.
|
|
65
|
+
* @returns A `NubeComponentImg` object representing the image component.
|
|
66
|
+
*/
|
|
13
67
|
declare const img: (props: NubeComponentImgProps) => NubeComponentImg;
|
|
14
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Creates a `txt` (text) component.
|
|
71
|
+
*
|
|
72
|
+
* The `txt` component is used to render text with optional styling.
|
|
73
|
+
* It supports properties such as `color`, `background`, `heading` levels (h1-h6),
|
|
74
|
+
* text formatting `modifiers` (bold, italic, etc.), and inline display.
|
|
75
|
+
*
|
|
76
|
+
* @param props - The properties for configuring the text component.
|
|
77
|
+
* @returns A `NubeComponentTxt` object representing the text component.
|
|
78
|
+
*/
|
|
15
79
|
declare const txt: (props: NubeComponentTxtProps) => NubeComponentTxt;
|
|
16
80
|
|
|
17
81
|
export { box, col, field, fragment, img, row, txt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,81 @@
|
|
|
1
1
|
import { NubeComponentBoxProps, NubeComponentBox, NubeComponentColProps, NubeComponentCol, NubeComponentRowProps, NubeComponentRow, NubeComponentFieldProps, NubeComponentField, NubeComponentFragmentProps, NubeComponentFragment, NubeComponentImgProps, NubeComponentImg, NubeComponentTxtProps, NubeComponentTxt } from '@tiendanube/nube-sdk-types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a `box` component.
|
|
5
|
+
*
|
|
6
|
+
* A `box` is a flexible container that can be used for layout purposes.
|
|
7
|
+
* It supports properties like width, height, padding, margin, and flex-based alignment.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The properties for configuring the box component.
|
|
10
|
+
* @returns A `NubeComponentBox` object representing the box component.
|
|
11
|
+
*/
|
|
3
12
|
declare const box: (props: NubeComponentBoxProps) => NubeComponentBox;
|
|
4
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Creates a `col` (column) component.
|
|
16
|
+
*
|
|
17
|
+
* A `col` is a flexible column container that can be used for structuring layouts.
|
|
18
|
+
* It inherits most properties from `box`, except for the `direction` property.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The properties for configuring the column component.
|
|
21
|
+
* @returns A `NubeComponentCol` object representing the column component.
|
|
22
|
+
*/
|
|
5
23
|
declare const col: (props: NubeComponentColProps) => NubeComponentCol;
|
|
6
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Creates a `row` component.
|
|
27
|
+
*
|
|
28
|
+
* A `row` is a flexible container used for structuring layouts in a horizontal direction.
|
|
29
|
+
* It inherits most properties from `box`, except for the `direction` property.
|
|
30
|
+
*
|
|
31
|
+
* @param props - The properties for configuring the row component.
|
|
32
|
+
* @returns A `NubeComponentRow` object representing the row component.
|
|
33
|
+
*/
|
|
7
34
|
declare const row: (props: NubeComponentRowProps) => NubeComponentRow;
|
|
8
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Creates a `field` component.
|
|
38
|
+
*
|
|
39
|
+
* A `field` represents an input element in a form, such as text fields, dropdowns, or checkboxes.
|
|
40
|
+
* It supports properties like `name`, `label`, and event handlers (`onChange`, `onBlur`, `onFocus`).
|
|
41
|
+
*
|
|
42
|
+
* @param props - The properties for configuring the field component.
|
|
43
|
+
* @returns A `NubeComponentField` object representing the form field.
|
|
44
|
+
*/
|
|
9
45
|
declare const field: (props: NubeComponentFieldProps) => NubeComponentField;
|
|
10
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Creates a `fragment` component.
|
|
49
|
+
*
|
|
50
|
+
* A `fragment` is a logical grouping element that allows multiple children
|
|
51
|
+
* to be wrapped without introducing an additional DOM node.
|
|
52
|
+
*
|
|
53
|
+
* @param props - The properties for configuring the fragment component.
|
|
54
|
+
* @returns A `NubeComponentFragment` object representing the fragment.
|
|
55
|
+
*/
|
|
11
56
|
declare const fragment: (props: NubeComponentFragmentProps) => NubeComponentFragment;
|
|
12
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Creates an `img` (image) component.
|
|
60
|
+
*
|
|
61
|
+
* The `img` component is used to display images. It supports properties such as
|
|
62
|
+
* `src`, `alt`, `width`, `height`, and responsive `sources` for different screen sizes.
|
|
63
|
+
*
|
|
64
|
+
* @param props - The properties for configuring the image component.
|
|
65
|
+
* @returns A `NubeComponentImg` object representing the image component.
|
|
66
|
+
*/
|
|
13
67
|
declare const img: (props: NubeComponentImgProps) => NubeComponentImg;
|
|
14
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Creates a `txt` (text) component.
|
|
71
|
+
*
|
|
72
|
+
* The `txt` component is used to render text with optional styling.
|
|
73
|
+
* It supports properties such as `color`, `background`, `heading` levels (h1-h6),
|
|
74
|
+
* text formatting `modifiers` (bold, italic, etc.), and inline display.
|
|
75
|
+
*
|
|
76
|
+
* @param props - The properties for configuring the text component.
|
|
77
|
+
* @returns A `NubeComponentTxt` object representing the text component.
|
|
78
|
+
*/
|
|
15
79
|
declare const txt: (props: NubeComponentTxtProps) => NubeComponentTxt;
|
|
16
80
|
|
|
17
81
|
export { box, col, field, fragment, img, row, txt };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/box.ts","../src/components/col.ts","../src/components/row.ts","../src/components/field.ts","../src/components/fragment.ts","../src/components/img.ts","../src/components/txt.ts"],"sourcesContent":["import type {\n\tNubeComponentBox,\n\tNubeComponentBoxProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const box = (props: NubeComponentBoxProps): NubeComponentBox => ({\n\ttype: \"box\",\n\t...props,\n});\n","import type {\n\tNubeComponentCol,\n\tNubeComponentColProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const col = (props: NubeComponentColProps): NubeComponentCol => ({\n\ttype: \"col\",\n\t...props,\n});\n","import type {\n\tNubeComponentRow,\n\tNubeComponentRowProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const row = (props: NubeComponentRowProps): NubeComponentRow => ({\n\ttype: \"row\",\n\t...props,\n});\n","import type {\n\tNubeComponentField,\n\tNubeComponentFieldProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const field = (props: NubeComponentFieldProps): NubeComponentField => ({\n\ttype: \"field\",\n\t...props,\n});\n","import type {\n\tNubeComponentFragment,\n\tNubeComponentFragmentProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const fragment = (\n\tprops: NubeComponentFragmentProps,\n): NubeComponentFragment => ({\n\ttype: \"fragment\",\n\t...props,\n});\n","import type {\n\tNubeComponentImg,\n\tNubeComponentImgProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const img = (props: NubeComponentImgProps): NubeComponentImg => ({\n\ttype: \"img\",\n\t...props,\n});\n","import type {\n\tNubeComponentTxt,\n\tNubeComponentTxtProps,\n} from \"@tiendanube/nube-sdk-types\";\n\nexport const txt = (props: NubeComponentTxtProps): NubeComponentTxt => ({\n\ttype: \"txt\",\n\t...props,\n});\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/components/box.ts","../src/components/col.ts","../src/components/row.ts","../src/components/field.ts","../src/components/fragment.ts","../src/components/img.ts","../src/components/txt.ts"],"sourcesContent":["import type {\n\tNubeComponentBox,\n\tNubeComponentBoxProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `box` component.\n *\n * A `box` is a flexible container that can be used for layout purposes.\n * It supports properties like width, height, padding, margin, and flex-based alignment.\n *\n * @param props - The properties for configuring the box component.\n * @returns A `NubeComponentBox` object representing the box component.\n */\nexport const box = (props: NubeComponentBoxProps): NubeComponentBox => ({\n\ttype: \"box\",\n\t...props,\n});\n","import type {\n\tNubeComponentCol,\n\tNubeComponentColProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `col` (column) component.\n *\n * A `col` is a flexible column container that can be used for structuring layouts.\n * It inherits most properties from `box`, except for the `direction` property.\n *\n * @param props - The properties for configuring the column component.\n * @returns A `NubeComponentCol` object representing the column component.\n */\nexport const col = (props: NubeComponentColProps): NubeComponentCol => ({\n\ttype: \"col\",\n\t...props,\n});\n","import type {\n\tNubeComponentRow,\n\tNubeComponentRowProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `row` component.\n *\n * A `row` is a flexible container used for structuring layouts in a horizontal direction.\n * It inherits most properties from `box`, except for the `direction` property.\n *\n * @param props - The properties for configuring the row component.\n * @returns A `NubeComponentRow` object representing the row component.\n */\nexport const row = (props: NubeComponentRowProps): NubeComponentRow => ({\n\ttype: \"row\",\n\t...props,\n});\n","import type {\n\tNubeComponentField,\n\tNubeComponentFieldProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `field` component.\n *\n * A `field` represents an input element in a form, such as text fields, dropdowns, or checkboxes.\n * It supports properties like `name`, `label`, and event handlers (`onChange`, `onBlur`, `onFocus`).\n *\n * @param props - The properties for configuring the field component.\n * @returns A `NubeComponentField` object representing the form field.\n */\nexport const field = (props: NubeComponentFieldProps): NubeComponentField => ({\n\ttype: \"field\",\n\t...props,\n});\n","import type {\n\tNubeComponentFragment,\n\tNubeComponentFragmentProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `fragment` component.\n *\n * A `fragment` is a logical grouping element that allows multiple children\n * to be wrapped without introducing an additional DOM node.\n *\n * @param props - The properties for configuring the fragment component.\n * @returns A `NubeComponentFragment` object representing the fragment.\n */\nexport const fragment = (\n\tprops: NubeComponentFragmentProps,\n): NubeComponentFragment => ({\n\ttype: \"fragment\",\n\t...props,\n});\n","import type {\n\tNubeComponentImg,\n\tNubeComponentImgProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates an `img` (image) component.\n *\n * The `img` component is used to display images. It supports properties such as\n * `src`, `alt`, `width`, `height`, and responsive `sources` for different screen sizes.\n *\n * @param props - The properties for configuring the image component.\n * @returns A `NubeComponentImg` object representing the image component.\n */\nexport const img = (props: NubeComponentImgProps): NubeComponentImg => ({\n\ttype: \"img\",\n\t...props,\n});\n","import type {\n\tNubeComponentTxt,\n\tNubeComponentTxtProps,\n} from \"@tiendanube/nube-sdk-types\";\n\n/**\n * Creates a `txt` (text) component.\n *\n * The `txt` component is used to render text with optional styling.\n * It supports properties such as `color`, `background`, `heading` levels (h1-h6),\n * text formatting `modifiers` (bold, italic, etc.), and inline display.\n *\n * @param props - The properties for configuring the text component.\n * @returns A `NubeComponentTxt` object representing the text component.\n */\nexport const txt = (props: NubeComponentTxtProps): NubeComponentTxt => ({\n\ttype: \"txt\",\n\t...props,\n});\n"],"mappings":";AAcO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,QAAQ,CAAC,WAAwD;AAAA,EAC7E,MAAM;AAAA,EACN,GAAG;AACJ;;;ACHO,IAAM,WAAW,CACvB,WAC4B;AAAA,EAC5B,MAAM;AAAA,EACN,GAAG;AACJ;;;ACLO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;;;ACFO,IAAM,MAAM,CAAC,WAAoD;AAAA,EACvE,MAAM;AAAA,EACN,GAAG;AACJ;","names":[]}
|