rook-cli 1.3.2 → 1.3.4
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/package.json +3 -2
- package/rook-framework/PRD-INSTALL-COMMAND.md +379 -0
- package/rook-framework/PRD.md +1214 -0
- package/rook-framework/README.md +143 -0
- package/rook-framework/assets/rk-accordion.js +99 -0
- package/rook-framework/assets/rk-alert-dialog.js +132 -0
- package/rook-framework/assets/rk-bottom-app-bar.js +88 -0
- package/rook-framework/assets/rk-carousel.js +145 -0
- package/rook-framework/assets/rk-collapsible.js +151 -0
- package/rook-framework/assets/rk-dialog.js +161 -0
- package/rook-framework/assets/rk-drawer.js +214 -0
- package/rook-framework/assets/rk-framework-core.css +2554 -0
- package/rook-framework/assets/rk-framework-tokens.css +101 -0
- package/rook-framework/assets/rk-modal.js +91 -0
- package/rook-framework/assets/rk-popover.js +264 -0
- package/rook-framework/assets/rk-progress.js +81 -0
- package/rook-framework/assets/rk-quantity.js +91 -0
- package/rook-framework/assets/rk-scroll-area.js +286 -0
- package/rook-framework/assets/rk-sheet.js +157 -0
- package/rook-framework/assets/rk-tabs.js +179 -0
- package/rook-framework/assets/rk-toggle.js +153 -0
- package/rook-framework/blocks/rk-accordion.liquid +97 -0
- package/rook-framework/blocks/rk-badge.liquid +103 -0
- package/rook-framework/blocks/rk-button.liquid +166 -0
- package/rook-framework/blocks/rk-divider.liquid +100 -0
- package/rook-framework/blocks/rk-form-field.liquid +120 -0
- package/rook-framework/blocks/rk-icon.liquid +134 -0
- package/rook-framework/blocks/rk-image.liquid +198 -0
- package/rook-framework/blocks/rk-installments.liquid +99 -0
- package/rook-framework/blocks/rk-pix-discount.liquid +99 -0
- package/rook-framework/blocks/rk-price.liquid +128 -0
- package/rook-framework/blocks/rk-quantity.liquid +108 -0
- package/rook-framework/blocks/rk-quick-add.liquid +137 -0
- package/rook-framework/blocks/rk-skeleton.liquid +104 -0
- package/rook-framework/blocks/rk-typography.liquid +183 -0
- package/rook-framework/config/rk-settings_schema.json +259 -0
- package/rook-framework/snippets/rk-accordion.liquid +31 -0
- package/rook-framework/snippets/rk-alert-dialog.liquid +83 -0
- package/rook-framework/snippets/rk-aspect-ratio.liquid +23 -0
- package/rook-framework/snippets/rk-badge.liquid +17 -0
- package/rook-framework/snippets/rk-bottom-app-bar.liquid +51 -0
- package/rook-framework/snippets/rk-button.liquid +49 -0
- package/rook-framework/snippets/rk-card.liquid +64 -0
- package/rook-framework/snippets/rk-carousel.liquid +74 -0
- package/rook-framework/snippets/rk-checkbox.liquid +34 -0
- package/rook-framework/snippets/rk-collapsible.liquid +52 -0
- package/rook-framework/snippets/rk-dialog.liquid +85 -0
- package/rook-framework/snippets/rk-divider.liquid +25 -0
- package/rook-framework/snippets/rk-drawer.liquid +81 -0
- package/rook-framework/snippets/rk-external-assets copy.liquid +33 -0
- package/rook-framework/snippets/rk-external-assets.liquid +68 -0
- package/rook-framework/snippets/rk-form-field.liquid +83 -0
- package/rook-framework/snippets/rk-gap-style.liquid +32 -0
- package/rook-framework/snippets/rk-icon.liquid +28 -0
- package/rook-framework/snippets/rk-image.liquid +60 -0
- package/rook-framework/snippets/rk-input.liquid +35 -0
- package/rook-framework/snippets/rk-installments.liquid +54 -0
- package/rook-framework/snippets/rk-item.liquid +69 -0
- package/rook-framework/snippets/rk-layout-style.liquid +37 -0
- package/rook-framework/snippets/rk-modal.liquid +31 -0
- package/rook-framework/snippets/rk-pix-discount.liquid +34 -0
- package/rook-framework/snippets/rk-popover.liquid +77 -0
- package/rook-framework/snippets/rk-price.liquid +48 -0
- package/rook-framework/snippets/rk-progress.liquid +38 -0
- package/rook-framework/snippets/rk-quantity.liquid +56 -0
- package/rook-framework/snippets/rk-quick-add.liquid +67 -0
- package/rook-framework/snippets/rk-scripts.liquid +17 -0
- package/rook-framework/snippets/rk-scroll-area.liquid +60 -0
- package/rook-framework/snippets/rk-sheet.liquid +86 -0
- package/rook-framework/snippets/rk-size-style.liquid +48 -0
- package/rook-framework/snippets/rk-skeleton.liquid +25 -0
- package/rook-framework/snippets/rk-spacing-padding.liquid +18 -0
- package/rook-framework/snippets/rk-spacing-style.liquid +54 -0
- package/rook-framework/snippets/rk-spinner.liquid +43 -0
- package/rook-framework/snippets/rk-swatch.liquid +33 -0
- package/rook-framework/snippets/rk-table.liquid +44 -0
- package/rook-framework/snippets/rk-tabs.liquid +52 -0
- package/rook-framework/snippets/rk-textarea.liquid +42 -0
- package/rook-framework/snippets/rk-toggle-group.liquid +27 -0
- package/rook-framework/snippets/rk-toggle.liquid +58 -0
- package/rook-framework/snippets/rk-typography.liquid +27 -0
- package/rook-framework/snippets/rk-variables.liquid +74 -0
- package/src/app.js +24 -0
- package/src/commands/InstallCommand.js +133 -0
- package/src/mcp/server.js +111 -1
- package/src/services/FrameworkInstaller.js +379 -0
- package/src/templates/block.liquid.txt +0 -15
- package/src/ui/PromptUI.js +15 -1
- package/src/utils/logger.js +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Rook UI Core — Toggle & Toggle Group Controllers
|
|
3
|
+
Web Components: <rk-toggle-element> & <rk-toggle-group>
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
if (!customElements.get('rk-toggle-element')) {
|
|
7
|
+
class RkToggleElement extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.button = null;
|
|
11
|
+
this._onClick = this._onClick.bind(this);
|
|
12
|
+
this._onKeyDown = this._onKeyDown.bind(this);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.button = this.querySelector('button');
|
|
17
|
+
if (!this.button) return;
|
|
18
|
+
|
|
19
|
+
// Ensure pressed state is properly set initially
|
|
20
|
+
if (!this.button.hasAttribute('aria-pressed')) {
|
|
21
|
+
this.button.setAttribute('aria-pressed', 'false');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.button.addEventListener('click', this._onClick);
|
|
25
|
+
this.button.addEventListener('keydown', this._onKeyDown);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
if (this.button) {
|
|
30
|
+
this.button.removeEventListener('click', this._onClick);
|
|
31
|
+
this.button.removeEventListener('keydown', this._onKeyDown);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get isPressed() {
|
|
36
|
+
return this.button?.getAttribute('aria-pressed') === 'true';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setPressed(value) {
|
|
40
|
+
if (!this.button || this.button.disabled) return;
|
|
41
|
+
|
|
42
|
+
const state = value ? 'true' : 'false';
|
|
43
|
+
this.button.setAttribute('aria-pressed', state);
|
|
44
|
+
|
|
45
|
+
if (value) {
|
|
46
|
+
this.button.classList.add('rk-toggle--on');
|
|
47
|
+
this.button.classList.remove('rk-toggle--off');
|
|
48
|
+
} else {
|
|
49
|
+
this.button.classList.add('rk-toggle--off');
|
|
50
|
+
this.button.classList.remove('rk-toggle--on');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this.dispatchEvent(new CustomEvent('rk:toggle:change', {
|
|
54
|
+
bubbles: true,
|
|
55
|
+
detail: { pressed: value, value: this.dataset.value }
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
toggle() {
|
|
60
|
+
this.setPressed(!this.isPressed);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_onClick(e) {
|
|
64
|
+
// If it's part of a group, let the group manage the selection logic
|
|
65
|
+
const group = this.closest('rk-toggle-group');
|
|
66
|
+
if (!group) {
|
|
67
|
+
this.toggle();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_onKeyDown(e) {
|
|
72
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
this.button.click();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
customElements.define('rk-toggle-element', RkToggleElement);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!customElements.get('rk-toggle-group')) {
|
|
83
|
+
class RkToggleGroup extends HTMLElement {
|
|
84
|
+
constructor() {
|
|
85
|
+
super();
|
|
86
|
+
this.type = this.dataset.type || 'single'; // 'single' or 'multiple'
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
this.addEventListener('rk:toggle:change', this._onToggleChange.bind(this));
|
|
91
|
+
|
|
92
|
+
// Set initial role
|
|
93
|
+
if (!this.hasAttribute('role')) {
|
|
94
|
+
this.setAttribute('role', 'group');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
get toggles() {
|
|
99
|
+
return Array.from(this.querySelectorAll('rk-toggle-element'));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
_onToggleChange(e) {
|
|
103
|
+
e.stopPropagation(); // Stop the pure toggle event
|
|
104
|
+
|
|
105
|
+
const clickedToggle = e.target;
|
|
106
|
+
const isNowPressed = clickedToggle.isPressed;
|
|
107
|
+
|
|
108
|
+
// Revert the pure toggle action first, because group manages it
|
|
109
|
+
clickedToggle.setPressed(!isNowPressed);
|
|
110
|
+
|
|
111
|
+
if (this.type === 'single') {
|
|
112
|
+
this._handleSingle(clickedToggle);
|
|
113
|
+
} else {
|
|
114
|
+
this._handleMultiple(clickedToggle);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
_handleSingle(toggle) {
|
|
119
|
+
const wasPressed = toggle.isPressed;
|
|
120
|
+
|
|
121
|
+
// Unpress all
|
|
122
|
+
this.toggles.forEach(t => t.setPressed(false));
|
|
123
|
+
|
|
124
|
+
// If it wasn't pressed before, press it now. If it was, let it stay unpressed (can unselect).
|
|
125
|
+
if (!wasPressed) {
|
|
126
|
+
toggle.setPressed(true);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
this._emitChange();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_handleMultiple(toggle) {
|
|
133
|
+
// Just toggle the current one natively
|
|
134
|
+
toggle.setPressed(!toggle.isPressed);
|
|
135
|
+
this._emitChange();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_emitChange() {
|
|
139
|
+
const selected = this.toggles
|
|
140
|
+
.filter(t => t.isPressed)
|
|
141
|
+
.map(t => t.dataset.value);
|
|
142
|
+
|
|
143
|
+
let value = this.type === 'single' ? (selected[0] || null) : selected;
|
|
144
|
+
|
|
145
|
+
this.dispatchEvent(new CustomEvent('rk:toggle-group:change', {
|
|
146
|
+
bubbles: true,
|
|
147
|
+
detail: { value }
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
customElements.define('rk-toggle-group', RkToggleGroup);
|
|
153
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
Block: RK Accordion
|
|
3
|
+
Renders a rk-accordion disclosure item.
|
|
4
|
+
Uses rk-spacing-style for Horizon-compatible spacing.
|
|
5
|
+
{% endcomment %}
|
|
6
|
+
|
|
7
|
+
<rk-accordion-block
|
|
8
|
+
id="block-{{ block.id }}"
|
|
9
|
+
{{ block.shopify_attributes }}
|
|
10
|
+
class="rk-block rk-spacing-style"
|
|
11
|
+
style="
|
|
12
|
+
{% render 'rk-spacing-style', settings: block.settings %}
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
{% render 'rk-accordion',
|
|
16
|
+
title: block.settings.title,
|
|
17
|
+
content: block.settings.content,
|
|
18
|
+
open: block.settings.open
|
|
19
|
+
%}
|
|
20
|
+
</rk-accordion-block>
|
|
21
|
+
|
|
22
|
+
{% schema %}
|
|
23
|
+
{
|
|
24
|
+
"name": "RK | Accordion",
|
|
25
|
+
"tag": null,
|
|
26
|
+
"settings": [
|
|
27
|
+
{
|
|
28
|
+
"type": "text",
|
|
29
|
+
"id": "title",
|
|
30
|
+
"label": "Título",
|
|
31
|
+
"default": "Pergunta ou título"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "richtext",
|
|
35
|
+
"id": "content",
|
|
36
|
+
"label": "Conteúdo",
|
|
37
|
+
"default": "<p>Resposta ou conteúdo do accordion.</p>"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "checkbox",
|
|
41
|
+
"id": "open",
|
|
42
|
+
"label": "Iniciar aberto",
|
|
43
|
+
"default": false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "header",
|
|
47
|
+
"content": "Espaçamento"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "range",
|
|
51
|
+
"id": "padding-block-start",
|
|
52
|
+
"label": "Topo",
|
|
53
|
+
"min": 0,
|
|
54
|
+
"max": 100,
|
|
55
|
+
"step": 2,
|
|
56
|
+
"unit": "px",
|
|
57
|
+
"default": 0
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "range",
|
|
61
|
+
"id": "padding-block-end",
|
|
62
|
+
"label": "Base",
|
|
63
|
+
"min": 0,
|
|
64
|
+
"max": 100,
|
|
65
|
+
"step": 2,
|
|
66
|
+
"unit": "px",
|
|
67
|
+
"default": 0
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "range",
|
|
71
|
+
"id": "padding-inline-start",
|
|
72
|
+
"label": "Esquerda",
|
|
73
|
+
"min": 0,
|
|
74
|
+
"max": 100,
|
|
75
|
+
"step": 2,
|
|
76
|
+
"unit": "px",
|
|
77
|
+
"default": 0
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "range",
|
|
81
|
+
"id": "padding-inline-end",
|
|
82
|
+
"label": "Direita",
|
|
83
|
+
"min": 0,
|
|
84
|
+
"max": 100,
|
|
85
|
+
"step": 2,
|
|
86
|
+
"unit": "px",
|
|
87
|
+
"default": 0
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"presets": [
|
|
91
|
+
{
|
|
92
|
+
"name": "RK | Accordion",
|
|
93
|
+
"category": "Rook UI"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
{% endschema %}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
Block: RK Badge
|
|
3
|
+
Renders a rk-badge label.
|
|
4
|
+
Uses rk-spacing-style for Horizon-compatible spacing.
|
|
5
|
+
{% endcomment %}
|
|
6
|
+
|
|
7
|
+
<rk-badge-block
|
|
8
|
+
id="block-{{ block.id }}"
|
|
9
|
+
{{ block.shopify_attributes }}
|
|
10
|
+
class="rk-block rk-spacing-style"
|
|
11
|
+
style="
|
|
12
|
+
{% render 'rk-spacing-style', settings: block.settings %}
|
|
13
|
+
{% if block.settings.alignment == 'center' %}text-align: center;{% elsif block.settings.alignment == 'right' %}text-align: right;{% endif %}
|
|
14
|
+
"
|
|
15
|
+
>
|
|
16
|
+
{% render 'rk-badge',
|
|
17
|
+
text: block.settings.text,
|
|
18
|
+
style: block.settings.style
|
|
19
|
+
%}
|
|
20
|
+
</rk-badge-block>
|
|
21
|
+
|
|
22
|
+
{% schema %}
|
|
23
|
+
{
|
|
24
|
+
"name": "RK | Badge",
|
|
25
|
+
"tag": null,
|
|
26
|
+
"settings": [
|
|
27
|
+
{
|
|
28
|
+
"type": "text",
|
|
29
|
+
"id": "text",
|
|
30
|
+
"label": "Texto do badge",
|
|
31
|
+
"default": "Novo"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "select",
|
|
35
|
+
"id": "style",
|
|
36
|
+
"label": "Estilo",
|
|
37
|
+
"options": [
|
|
38
|
+
{ "value": "primary", "label": "Primário" },
|
|
39
|
+
{ "value": "success", "label": "Sucesso (verde)" },
|
|
40
|
+
{ "value": "danger", "label": "Alerta (vermelho)" },
|
|
41
|
+
{ "value": "outline", "label": "Outline" }
|
|
42
|
+
],
|
|
43
|
+
"default": "primary"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "text_alignment",
|
|
47
|
+
"id": "alignment",
|
|
48
|
+
"label": "Alinhamento",
|
|
49
|
+
"default": "left"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "header",
|
|
53
|
+
"content": "Espaçamento"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "range",
|
|
57
|
+
"id": "padding-block-start",
|
|
58
|
+
"label": "Topo",
|
|
59
|
+
"min": 0,
|
|
60
|
+
"max": 100,
|
|
61
|
+
"step": 2,
|
|
62
|
+
"unit": "px",
|
|
63
|
+
"default": 0
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "range",
|
|
67
|
+
"id": "padding-block-end",
|
|
68
|
+
"label": "Base",
|
|
69
|
+
"min": 0,
|
|
70
|
+
"max": 100,
|
|
71
|
+
"step": 2,
|
|
72
|
+
"unit": "px",
|
|
73
|
+
"default": 0
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "range",
|
|
77
|
+
"id": "padding-inline-start",
|
|
78
|
+
"label": "Esquerda",
|
|
79
|
+
"min": 0,
|
|
80
|
+
"max": 100,
|
|
81
|
+
"step": 2,
|
|
82
|
+
"unit": "px",
|
|
83
|
+
"default": 0
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "range",
|
|
87
|
+
"id": "padding-inline-end",
|
|
88
|
+
"label": "Direita",
|
|
89
|
+
"min": 0,
|
|
90
|
+
"max": 100,
|
|
91
|
+
"step": 2,
|
|
92
|
+
"unit": "px",
|
|
93
|
+
"default": 0
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"presets": [
|
|
97
|
+
{
|
|
98
|
+
"name": "RK | Badge",
|
|
99
|
+
"category": "Rook UI"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
{% endschema %}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
Block: RK Button
|
|
3
|
+
Renders a rk-button with full customizer control.
|
|
4
|
+
Uses rk-size-style and rk-spacing-style for Horizon-compatible sizing and spacing.
|
|
5
|
+
{% endcomment %}
|
|
6
|
+
|
|
7
|
+
<rk-button-block
|
|
8
|
+
id="block-{{ block.id }}"
|
|
9
|
+
{{ block.shopify_attributes }}
|
|
10
|
+
class="rk-block rk-size-style rk-spacing-style"
|
|
11
|
+
style="
|
|
12
|
+
{% render 'rk-size-style', settings: block.settings %}
|
|
13
|
+
{% render 'rk-spacing-style', settings: block.settings %}
|
|
14
|
+
{% if block.settings.alignment == 'center' %}text-align: center;{% elsif block.settings.alignment == 'right' %}text-align: right;{% endif %}
|
|
15
|
+
"
|
|
16
|
+
>
|
|
17
|
+
{% render 'rk-button',
|
|
18
|
+
text: block.settings.text,
|
|
19
|
+
url: block.settings.url,
|
|
20
|
+
style: block.settings.style,
|
|
21
|
+
size: block.settings.size,
|
|
22
|
+
full_width: block.settings.full_width,
|
|
23
|
+
icon: block.settings.icon
|
|
24
|
+
%}
|
|
25
|
+
</rk-button-block>
|
|
26
|
+
|
|
27
|
+
{% schema %}
|
|
28
|
+
{
|
|
29
|
+
"name": "RK | Botão",
|
|
30
|
+
"tag": null,
|
|
31
|
+
"settings": [
|
|
32
|
+
{
|
|
33
|
+
"type": "text",
|
|
34
|
+
"id": "text",
|
|
35
|
+
"label": "Texto do botão",
|
|
36
|
+
"default": "Clique aqui"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "url",
|
|
40
|
+
"id": "url",
|
|
41
|
+
"label": "Link"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "select",
|
|
45
|
+
"id": "style",
|
|
46
|
+
"label": "Estilo",
|
|
47
|
+
"options": [
|
|
48
|
+
{ "value": "primary", "label": "Primário" },
|
|
49
|
+
{ "value": "secondary", "label": "Secundário" },
|
|
50
|
+
{ "value": "outline", "label": "Outline" },
|
|
51
|
+
{ "value": "ghost", "label": "Ghost" },
|
|
52
|
+
{ "value": "link", "label": "Link" }
|
|
53
|
+
],
|
|
54
|
+
"default": "primary"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"type": "select",
|
|
58
|
+
"id": "size",
|
|
59
|
+
"label": "Tamanho",
|
|
60
|
+
"options": [
|
|
61
|
+
{ "value": "sm", "label": "Pequeno" },
|
|
62
|
+
{ "value": "md", "label": "Médio" },
|
|
63
|
+
{ "value": "lg", "label": "Grande" }
|
|
64
|
+
],
|
|
65
|
+
"default": "md"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "checkbox",
|
|
69
|
+
"id": "full_width",
|
|
70
|
+
"label": "Largura total",
|
|
71
|
+
"default": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "text",
|
|
75
|
+
"id": "icon",
|
|
76
|
+
"label": "Ícone (nome)",
|
|
77
|
+
"info": "Ex: heart, cart, arrow"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "header",
|
|
81
|
+
"content": "Dimensionamento"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "select",
|
|
85
|
+
"id": "width",
|
|
86
|
+
"label": "Largura",
|
|
87
|
+
"options": [
|
|
88
|
+
{ "value": "fit-content", "label": "Ajustar ao conteúdo" },
|
|
89
|
+
{ "value": "fill", "label": "Preencher" },
|
|
90
|
+
{ "value": "custom", "label": "Personalizado" }
|
|
91
|
+
],
|
|
92
|
+
"default": "fit-content"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"type": "range",
|
|
96
|
+
"id": "custom_width",
|
|
97
|
+
"label": "Largura personalizada",
|
|
98
|
+
"min": 10,
|
|
99
|
+
"max": 100,
|
|
100
|
+
"step": 5,
|
|
101
|
+
"unit": "%",
|
|
102
|
+
"default": 100
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "header",
|
|
106
|
+
"content": "Layout"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"type": "text_alignment",
|
|
110
|
+
"id": "alignment",
|
|
111
|
+
"label": "Alinhamento",
|
|
112
|
+
"default": "left"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "header",
|
|
116
|
+
"content": "Espaçamento"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "range",
|
|
120
|
+
"id": "padding-block-start",
|
|
121
|
+
"label": "Topo",
|
|
122
|
+
"min": 0,
|
|
123
|
+
"max": 100,
|
|
124
|
+
"step": 2,
|
|
125
|
+
"unit": "px",
|
|
126
|
+
"default": 0
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"type": "range",
|
|
130
|
+
"id": "padding-block-end",
|
|
131
|
+
"label": "Base",
|
|
132
|
+
"min": 0,
|
|
133
|
+
"max": 100,
|
|
134
|
+
"step": 2,
|
|
135
|
+
"unit": "px",
|
|
136
|
+
"default": 0
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"type": "range",
|
|
140
|
+
"id": "padding-inline-start",
|
|
141
|
+
"label": "Esquerda",
|
|
142
|
+
"min": 0,
|
|
143
|
+
"max": 100,
|
|
144
|
+
"step": 2,
|
|
145
|
+
"unit": "px",
|
|
146
|
+
"default": 0
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "range",
|
|
150
|
+
"id": "padding-inline-end",
|
|
151
|
+
"label": "Direita",
|
|
152
|
+
"min": 0,
|
|
153
|
+
"max": 100,
|
|
154
|
+
"step": 2,
|
|
155
|
+
"unit": "px",
|
|
156
|
+
"default": 0
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"presets": [
|
|
160
|
+
{
|
|
161
|
+
"name": "RK | Botão",
|
|
162
|
+
"category": "Rook UI"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
{% endschema %}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
Block: RK Divider
|
|
3
|
+
Renders a rk-divider separator.
|
|
4
|
+
Uses rk-spacing-style for Horizon-compatible spacing.
|
|
5
|
+
{% endcomment %}
|
|
6
|
+
|
|
7
|
+
<rk-divider-block
|
|
8
|
+
id="block-{{ block.id }}"
|
|
9
|
+
{{ block.shopify_attributes }}
|
|
10
|
+
class="rk-block rk-spacing-style"
|
|
11
|
+
style="
|
|
12
|
+
{% render 'rk-spacing-style', settings: block.settings %}
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
{% render 'rk-divider',
|
|
16
|
+
thickness: block.settings.thickness,
|
|
17
|
+
width: block.settings.width
|
|
18
|
+
%}
|
|
19
|
+
</rk-divider-block>
|
|
20
|
+
|
|
21
|
+
{% schema %}
|
|
22
|
+
{
|
|
23
|
+
"name": "RK | Divisor",
|
|
24
|
+
"tag": null,
|
|
25
|
+
"settings": [
|
|
26
|
+
{
|
|
27
|
+
"type": "range",
|
|
28
|
+
"id": "thickness",
|
|
29
|
+
"label": "Espessura",
|
|
30
|
+
"min": 1,
|
|
31
|
+
"max": 8,
|
|
32
|
+
"step": 1,
|
|
33
|
+
"unit": "px",
|
|
34
|
+
"default": 1
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "select",
|
|
38
|
+
"id": "width",
|
|
39
|
+
"label": "Largura",
|
|
40
|
+
"options": [
|
|
41
|
+
{ "value": "25%", "label": "25%" },
|
|
42
|
+
{ "value": "50%", "label": "50%" },
|
|
43
|
+
{ "value": "75%", "label": "75%" },
|
|
44
|
+
{ "value": "100%", "label": "100%" }
|
|
45
|
+
],
|
|
46
|
+
"default": "100%"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "header",
|
|
50
|
+
"content": "Espaçamento"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "range",
|
|
54
|
+
"id": "padding-block-start",
|
|
55
|
+
"label": "Topo",
|
|
56
|
+
"min": 0,
|
|
57
|
+
"max": 100,
|
|
58
|
+
"step": 2,
|
|
59
|
+
"unit": "px",
|
|
60
|
+
"default": 8
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "range",
|
|
64
|
+
"id": "padding-block-end",
|
|
65
|
+
"label": "Base",
|
|
66
|
+
"min": 0,
|
|
67
|
+
"max": 100,
|
|
68
|
+
"step": 2,
|
|
69
|
+
"unit": "px",
|
|
70
|
+
"default": 8
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "range",
|
|
74
|
+
"id": "padding-inline-start",
|
|
75
|
+
"label": "Esquerda",
|
|
76
|
+
"min": 0,
|
|
77
|
+
"max": 100,
|
|
78
|
+
"step": 2,
|
|
79
|
+
"unit": "px",
|
|
80
|
+
"default": 0
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "range",
|
|
84
|
+
"id": "padding-inline-end",
|
|
85
|
+
"label": "Direita",
|
|
86
|
+
"min": 0,
|
|
87
|
+
"max": 100,
|
|
88
|
+
"step": 2,
|
|
89
|
+
"unit": "px",
|
|
90
|
+
"default": 0
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"presets": [
|
|
94
|
+
{
|
|
95
|
+
"name": "RK | Divisor",
|
|
96
|
+
"category": "Rook UI"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
{% endschema %}
|