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,259 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "Rook UI — Cores",
|
|
4
|
+
"settings": [
|
|
5
|
+
{
|
|
6
|
+
"type": "paragraph",
|
|
7
|
+
"content": "Cores globais do Rook UI Core Framework. Essas cores são usadas por todos os componentes rk-*."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"type": "header",
|
|
11
|
+
"content": "Cores Primárias"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "color",
|
|
15
|
+
"id": "rk_color_primary",
|
|
16
|
+
"label": "Cor Primária",
|
|
17
|
+
"default": "#000000",
|
|
18
|
+
"info": "Cor principal dos botões, links e destaques."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "color",
|
|
22
|
+
"id": "rk_color_primary_hover",
|
|
23
|
+
"label": "Cor Primária (Hover)",
|
|
24
|
+
"default": "#1a1a1a"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "color",
|
|
28
|
+
"id": "rk_color_primary_foreground",
|
|
29
|
+
"label": "Texto sobre Primária",
|
|
30
|
+
"default": "#ffffff",
|
|
31
|
+
"info": "Cor do texto quando o fundo é a cor primária."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "header",
|
|
35
|
+
"content": "Cores Secundárias"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "color",
|
|
39
|
+
"id": "rk_color_secondary",
|
|
40
|
+
"label": "Cor Secundária",
|
|
41
|
+
"default": "#ffffff"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "color",
|
|
45
|
+
"id": "rk_color_secondary_hover",
|
|
46
|
+
"label": "Cor Secundária (Hover)",
|
|
47
|
+
"default": "#f5f5f5"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "header",
|
|
51
|
+
"content": "Cores de Fundo"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "color",
|
|
55
|
+
"id": "rk_color_background",
|
|
56
|
+
"label": "Fundo da Página",
|
|
57
|
+
"default": "#ffffff",
|
|
58
|
+
"info": "Cor de fundo geral dos componentes do framework."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "color",
|
|
62
|
+
"id": "rk_color_background_secondary",
|
|
63
|
+
"label": "Fundo Secundário",
|
|
64
|
+
"default": "#f5f5f5",
|
|
65
|
+
"info": "Usado em tabs, toggles, cards e áreas com destaque sutil."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "header",
|
|
69
|
+
"content": "Cores Semânticas"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "color",
|
|
73
|
+
"id": "rk_color_success",
|
|
74
|
+
"label": "Cor de Sucesso",
|
|
75
|
+
"default": "#22c55e"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "color",
|
|
79
|
+
"id": "rk_color_danger",
|
|
80
|
+
"label": "Cor de Erro / Perigo",
|
|
81
|
+
"default": "#ef4444"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "header",
|
|
85
|
+
"content": "Texto e Bordas"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "color",
|
|
89
|
+
"id": "rk_color_text",
|
|
90
|
+
"label": "Cor do Texto Base",
|
|
91
|
+
"default": "#1a1a1a"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "color",
|
|
95
|
+
"id": "rk_color_text_muted",
|
|
96
|
+
"label": "Cor do Texto Secundário",
|
|
97
|
+
"default": "#737373"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "color",
|
|
101
|
+
"id": "rk_color_border",
|
|
102
|
+
"label": "Cor da Borda",
|
|
103
|
+
"default": "#e5e5e5"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "color",
|
|
107
|
+
"id": "rk_color_ring",
|
|
108
|
+
"label": "Cor do Anel de Foco (Focus Ring)",
|
|
109
|
+
"default": "#0f172a",
|
|
110
|
+
"info": "Cor utilizada no outline de foco (acessibilidade)."
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "Rook UI — Forma e Transição",
|
|
116
|
+
"settings": [
|
|
117
|
+
{
|
|
118
|
+
"type": "paragraph",
|
|
119
|
+
"content": "Controle de arredondamento (border-radius), espaçamentos e transições dos componentes rk-*."
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "header",
|
|
123
|
+
"content": "Arredondamento (Border Radius)"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "range",
|
|
127
|
+
"id": "rk_border_radius",
|
|
128
|
+
"min": 0,
|
|
129
|
+
"max": 40,
|
|
130
|
+
"step": 2,
|
|
131
|
+
"unit": "px",
|
|
132
|
+
"label": "Arredondamento Padrão",
|
|
133
|
+
"default": 8,
|
|
134
|
+
"info": "Aplicado em botões, inputs, cards e a maioria dos componentes."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "range",
|
|
138
|
+
"id": "rk_border_radius_sm",
|
|
139
|
+
"min": 0,
|
|
140
|
+
"max": 20,
|
|
141
|
+
"step": 1,
|
|
142
|
+
"unit": "px",
|
|
143
|
+
"label": "Arredondamento Pequeno",
|
|
144
|
+
"default": 4,
|
|
145
|
+
"info": "Usado em badges, itens de menu e elementos menores."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": "range",
|
|
149
|
+
"id": "rk_border_radius_lg",
|
|
150
|
+
"min": 0,
|
|
151
|
+
"max": 40,
|
|
152
|
+
"step": 2,
|
|
153
|
+
"unit": "px",
|
|
154
|
+
"label": "Arredondamento Grande",
|
|
155
|
+
"default": 12,
|
|
156
|
+
"info": "Usado em cards e containers maiores."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "range",
|
|
160
|
+
"id": "rk_border_radius_pill",
|
|
161
|
+
"min": 0,
|
|
162
|
+
"max": 100,
|
|
163
|
+
"step": 2,
|
|
164
|
+
"unit": "px",
|
|
165
|
+
"label": "Arredondamento Pill",
|
|
166
|
+
"default": 50,
|
|
167
|
+
"info": "Formato pill/arredondado completo (scrollbar thumbs, badges pill, etc)."
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"type": "header",
|
|
171
|
+
"content": "Transição"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "range",
|
|
175
|
+
"id": "rk_transition_speed",
|
|
176
|
+
"min": 100,
|
|
177
|
+
"max": 800,
|
|
178
|
+
"step": 50,
|
|
179
|
+
"unit": "ms",
|
|
180
|
+
"label": "Velocidade da Transição",
|
|
181
|
+
"default": 300,
|
|
182
|
+
"info": "Controla a velocidade de hover, abertura de modals, drawers e outros efeitos."
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "Rook UI — Parcelamento",
|
|
188
|
+
"settings": [
|
|
189
|
+
{
|
|
190
|
+
"type": "paragraph",
|
|
191
|
+
"content": "Configurações de cálculo de parcelamento exibidas pelos componentes rk-installments."
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"type": "checkbox",
|
|
195
|
+
"id": "rk_installments_enabled",
|
|
196
|
+
"label": "Ativar Parcelamento",
|
|
197
|
+
"default": true
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "number",
|
|
201
|
+
"id": "rk_installments_max",
|
|
202
|
+
"label": "Quantidade Máxima de Parcelas",
|
|
203
|
+
"default": 12
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"type": "number",
|
|
207
|
+
"id": "rk_installments_without_interest",
|
|
208
|
+
"label": "Quantidade de Parcelas Sem Juros",
|
|
209
|
+
"default": 3
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"type": "text",
|
|
213
|
+
"id": "rk_installments_min_value",
|
|
214
|
+
"label": "Valor Mínimo da Parcela (em centavos)",
|
|
215
|
+
"info": "Ex: 500 para representar R$ 5,00",
|
|
216
|
+
"default": "500"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"type": "text",
|
|
220
|
+
"id": "rk_installments_interest_rate",
|
|
221
|
+
"label": "Taxa de Juros ao Mês (%)",
|
|
222
|
+
"info": "Ex: 2.99",
|
|
223
|
+
"default": "2.99"
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "Rook UI — Pix",
|
|
229
|
+
"settings": [
|
|
230
|
+
{
|
|
231
|
+
"type": "paragraph",
|
|
232
|
+
"content": "Configurações de desconto Pix exibidas pelos componentes rk-pix-discount."
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "checkbox",
|
|
236
|
+
"id": "rk_pix_enabled",
|
|
237
|
+
"label": "Ativar Desconto Pix",
|
|
238
|
+
"default": true
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"type": "range",
|
|
242
|
+
"id": "rk_pix_discount",
|
|
243
|
+
"min": 0,
|
|
244
|
+
"max": 30,
|
|
245
|
+
"step": 1,
|
|
246
|
+
"unit": "%",
|
|
247
|
+
"label": "Porcentagem de Desconto no Pix",
|
|
248
|
+
"default": 5
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"type": "text",
|
|
252
|
+
"id": "rk_pix_label",
|
|
253
|
+
"label": "Texto do Pix",
|
|
254
|
+
"default": "no Pix",
|
|
255
|
+
"info": "Texto exibido ao lado do valor com desconto (ex: 'no Pix', 'via Pix')."
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkAccordion
|
|
3
|
+
Renders a disclosure / accordion using <details> + Web Component.
|
|
4
|
+
|
|
5
|
+
@param {string} title - The accordion header text
|
|
6
|
+
@param {string} content - The content to show/hide (HTML safe)
|
|
7
|
+
@param {boolean} [open] - Whether it should start open
|
|
8
|
+
@param {string} [custom_class] - Extra CSS classes
|
|
9
|
+
|
|
10
|
+
@example
|
|
11
|
+
{% render 'rk-accordion', title: 'Descrição', content: product.description %}
|
|
12
|
+
{% enddoc %}
|
|
13
|
+
|
|
14
|
+
<rk-accordion-element>
|
|
15
|
+
<details
|
|
16
|
+
class="rk-accordion{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
17
|
+
{% if open %}open{% endif %}
|
|
18
|
+
>
|
|
19
|
+
<summary class="rk-accordion__trigger">
|
|
20
|
+
<span>{{ title }}</span>
|
|
21
|
+
<span class="rk-accordion__icon" aria-hidden="true">
|
|
22
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
23
|
+
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
24
|
+
</svg>
|
|
25
|
+
</span>
|
|
26
|
+
</summary>
|
|
27
|
+
<div class="rk-accordion__content">
|
|
28
|
+
{{ content }}
|
|
29
|
+
</div>
|
|
30
|
+
</details>
|
|
31
|
+
</rk-accordion-element>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkAlertDialog
|
|
3
|
+
Renders an Alert Dialog for critical confirmations.
|
|
4
|
+
Uses Web Component <rk-alert-dialog-element> for behaviour.
|
|
5
|
+
|
|
6
|
+
Unlike the standard Modal, the Alert Dialog:
|
|
7
|
+
- Does NOT close on overlay click
|
|
8
|
+
- Focuses the Cancel button by default (safety)
|
|
9
|
+
- Uses role="alertdialog" for assistive technologies
|
|
10
|
+
|
|
11
|
+
@param {string} id - Unique alert dialog id
|
|
12
|
+
@param {string} title - Alert title (required)
|
|
13
|
+
@param {string} [description] - Explanatory text about consequences
|
|
14
|
+
@param {string} [cancel_text] - Cancel button text (default: 'Cancelar')
|
|
15
|
+
@param {string} [confirm_text] - Confirm button text (default: 'Confirmar')
|
|
16
|
+
@param {string} [confirm_style] - Confirm button rk-button style (default: 'primary')
|
|
17
|
+
@param {boolean} [esc_close] - Allow ESC key to close (default: true)
|
|
18
|
+
@param {string} [custom_class] - Extra CSS classes
|
|
19
|
+
|
|
20
|
+
@example
|
|
21
|
+
{% render 'rk-alert-dialog',
|
|
22
|
+
id: 'delete-account',
|
|
23
|
+
title: 'Você tem certeza absoluta?',
|
|
24
|
+
description: 'Esta ação não pode ser desfeita. Isso excluirá permanentemente sua conta.',
|
|
25
|
+
cancel_text: 'Cancelar',
|
|
26
|
+
confirm_text: 'Excluir Conta',
|
|
27
|
+
confirm_style: 'danger'
|
|
28
|
+
%}
|
|
29
|
+
{% enddoc %}
|
|
30
|
+
|
|
31
|
+
{%- liquid
|
|
32
|
+
assign ad_cancel_text = cancel_text | default: 'Cancelar'
|
|
33
|
+
assign ad_confirm_text = confirm_text | default: 'Confirmar'
|
|
34
|
+
assign ad_confirm_style = confirm_style | default: 'primary'
|
|
35
|
+
assign ad_esc_close = esc_close | default: true
|
|
36
|
+
-%}
|
|
37
|
+
|
|
38
|
+
{%- capture title_id -%}{{ id }}-title{%- endcapture -%}
|
|
39
|
+
{%- capture desc_id -%}{{ id }}-desc{%- endcapture -%}
|
|
40
|
+
|
|
41
|
+
<rk-alert-dialog-element data-alert-dialog-id="{{ id }}" data-esc-close="{{ ad_esc_close }}">
|
|
42
|
+
<div
|
|
43
|
+
id="{{ id }}"
|
|
44
|
+
class="rk-alert-dialog{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
45
|
+
>
|
|
46
|
+
{%- comment -%} Overlay (non-dismissable) {%- endcomment -%}
|
|
47
|
+
<div class="rk-alert-dialog__overlay"></div>
|
|
48
|
+
|
|
49
|
+
{%- comment -%} Content {%- endcomment -%}
|
|
50
|
+
<div
|
|
51
|
+
class="rk-alert-dialog__content"
|
|
52
|
+
role="alertdialog"
|
|
53
|
+
aria-modal="true"
|
|
54
|
+
aria-labelledby="{{ title_id }}"
|
|
55
|
+
{% if description %}aria-describedby="{{ desc_id }}"{% endif %}
|
|
56
|
+
>
|
|
57
|
+
<div class="rk-alert-dialog__header">
|
|
58
|
+
<h2 id="{{ title_id }}" class="rk-alert-dialog__title">{{ title }}</h2>
|
|
59
|
+
{%- if description -%}
|
|
60
|
+
<p id="{{ desc_id }}" class="rk-alert-dialog__description">{{ description }}</p>
|
|
61
|
+
{%- endif -%}
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="rk-alert-dialog__footer">
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
class="rk-btn rk-btn--secondary rk-btn--md"
|
|
68
|
+
data-action="cancel"
|
|
69
|
+
>
|
|
70
|
+
<span class="rk-btn__text">{{ ad_cancel_text }}</span>
|
|
71
|
+
</button>
|
|
72
|
+
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
class="rk-btn rk-btn--{{ ad_confirm_style }} rk-btn--md"
|
|
76
|
+
data-action="confirm"
|
|
77
|
+
>
|
|
78
|
+
<span class="rk-btn__text">{{ ad_confirm_text }}</span>
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</rk-alert-dialog-element>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkAspectRatio
|
|
3
|
+
Um container utilitário que força uma proporção específica (aspect-ratio) no seu conteúdo.
|
|
4
|
+
Ideal para imagens, embeds, iframes e esqueletos de carregamento.
|
|
5
|
+
|
|
6
|
+
@param {string} content - O conteúdo html a ser encaixado (ex: tag img, iframe). Age como `asChild`.
|
|
7
|
+
@param {string} [ratio] - A proporção (ex: '16/9', '4/3', '1/1', '21/9'). Padrão: '16/9'
|
|
8
|
+
@param {string} [custom_class] - Classes CSS adicionais.
|
|
9
|
+
|
|
10
|
+
@example
|
|
11
|
+
{% capture media_img %}
|
|
12
|
+
<img src="{{ product.featured_image | image_url: width: 800 }}" alt="{{ product.title }}">
|
|
13
|
+
{% endcapture %}
|
|
14
|
+
{% render 'rk-aspect-ratio', content: media_img, ratio: '1/1' %}
|
|
15
|
+
{% enddoc %}
|
|
16
|
+
|
|
17
|
+
{%- liquid
|
|
18
|
+
assign t_ratio = ratio | default: '16/9'
|
|
19
|
+
-%}
|
|
20
|
+
|
|
21
|
+
<div class="rk-aspect-ratio{% if custom_class %} {{ custom_class }}{% endif %}" style="aspect-ratio: {{ t_ratio }};">
|
|
22
|
+
{{ content }}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkBadge
|
|
3
|
+
Renders a small label badge.
|
|
4
|
+
|
|
5
|
+
@param {string} text - Badge text
|
|
6
|
+
@param {string} [style] - 'primary' | 'success' | 'danger' | 'outline' (default: 'primary')
|
|
7
|
+
@param {string} [custom_class] - Extra CSS classes
|
|
8
|
+
|
|
9
|
+
@example
|
|
10
|
+
{% render 'rk-badge', text: 'Novo', style: 'success' %}
|
|
11
|
+
{% enddoc %}
|
|
12
|
+
|
|
13
|
+
{%- assign badge_style = style | default: 'primary' -%}
|
|
14
|
+
|
|
15
|
+
<span class="rk-badge rk-badge--{{ badge_style }}{% if custom_class %} {{ custom_class }}{% endif %}">
|
|
16
|
+
{{ text }}
|
|
17
|
+
</span>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkBottomAppBar
|
|
3
|
+
Renders a Bottom App Bar (Menubar style) that fixes at the screen bottom.
|
|
4
|
+
Includes a Glassmorphism effect and Safe Area support.
|
|
5
|
+
|
|
6
|
+
@param {string} content - HTML content representing the buttons/links. MUST use `role="menuitem"` for JS keyboard tracking.
|
|
7
|
+
@param {string} [fab] - HTML content for a Floating Action Button in the center.
|
|
8
|
+
@param {string} [id] - Unique ID for the bar
|
|
9
|
+
@param {string} [alignment] - 'distributed' | 'grouped' (default: 'distributed')
|
|
10
|
+
@param {string} [custom_class] - Extra CSS classes
|
|
11
|
+
|
|
12
|
+
@example
|
|
13
|
+
{% capture app_bar_items %}
|
|
14
|
+
<button role="menuitem" class="rk-bottom-app-bar__item">
|
|
15
|
+
<span>Home</span>
|
|
16
|
+
</button>
|
|
17
|
+
<button role="menuitem" class="rk-bottom-app-bar__item">
|
|
18
|
+
<span>Categorias</span>
|
|
19
|
+
</button>
|
|
20
|
+
{% endcapture %}
|
|
21
|
+
|
|
22
|
+
{% capture my_fab %}
|
|
23
|
+
<button role="menuitem" class="rk-bottom-app-bar__fab">🛒</button>
|
|
24
|
+
{% endcapture %}
|
|
25
|
+
|
|
26
|
+
{% render 'rk-bottom-app-bar', content: app_bar_items, fab: my_fab, alignment: 'grouped' %}
|
|
27
|
+
{% enddoc %}
|
|
28
|
+
|
|
29
|
+
{%- liquid
|
|
30
|
+
assign t_alignment = alignment | default: 'distributed'
|
|
31
|
+
assign t_id = id | default: 'rk-bottom-app-bar'
|
|
32
|
+
-%}
|
|
33
|
+
|
|
34
|
+
<rk-bottom-app-bar-element
|
|
35
|
+
id="{{ t_id }}"
|
|
36
|
+
class="rk-bottom-app-bar rk-bottom-app-bar--{{ t_alignment }}{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
37
|
+
role="menubar"
|
|
38
|
+
aria-label="Bottom Navigation"
|
|
39
|
+
>
|
|
40
|
+
{%- comment -%} Optional FAB that breaks the edge {%- endcomment -%}
|
|
41
|
+
{%- if fab -%}
|
|
42
|
+
<div class="rk-bottom-app-bar__fab-wrapper">
|
|
43
|
+
{{ fab }}
|
|
44
|
+
</div>
|
|
45
|
+
{%- endif -%}
|
|
46
|
+
|
|
47
|
+
{%- comment -%} Normal Items Row {%- endcomment -%}
|
|
48
|
+
<div class="rk-bottom-app-bar__row">
|
|
49
|
+
{{ content }}
|
|
50
|
+
</div>
|
|
51
|
+
</rk-bottom-app-bar-element>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkButton
|
|
3
|
+
Renders a button or link with style variants.
|
|
4
|
+
|
|
5
|
+
@param {string} text - Button label text
|
|
6
|
+
@param {string} [url] - If set, renders as <a> instead of <button>
|
|
7
|
+
@param {string} [style] - 'primary' | 'secondary' | 'outline' | 'ghost' | 'link' (default: 'primary')
|
|
8
|
+
@param {string} [size] - 'sm' | 'md' | 'lg' (default: 'md')
|
|
9
|
+
@param {string} [type] - Button type attribute ('button' | 'submit'), default: 'button'
|
|
10
|
+
@param {boolean} [disabled] - Disables the button
|
|
11
|
+
@param {boolean} [loading] - Shows spinner state
|
|
12
|
+
@param {boolean} [full_width] - Makes the button 100% width
|
|
13
|
+
@param {string} [icon] - Icon name to render before text
|
|
14
|
+
@param {string} [custom_class] - Extra CSS classes
|
|
15
|
+
@param {string} [attr] - Additional HTML attributes (e.g. data-*, aria-*)
|
|
16
|
+
@param {boolean} [open_in_new_tab] - Opens link in new tab
|
|
17
|
+
|
|
18
|
+
@example
|
|
19
|
+
{% render 'rk-button', text: 'Buy Now', style: 'primary', size: 'lg' %}
|
|
20
|
+
{% render 'rk-button', text: 'Learn More', url: '/about', style: 'outline' %}
|
|
21
|
+
{% enddoc %}
|
|
22
|
+
|
|
23
|
+
{%- liquid
|
|
24
|
+
assign tag = 'button'
|
|
25
|
+
if url != blank
|
|
26
|
+
assign tag = 'a'
|
|
27
|
+
endif
|
|
28
|
+
|
|
29
|
+
assign btn_style = style | default: 'primary'
|
|
30
|
+
assign btn_size = size | default: 'md'
|
|
31
|
+
assign btn_type = type | default: 'button'
|
|
32
|
+
-%}
|
|
33
|
+
|
|
34
|
+
<{{ tag }}
|
|
35
|
+
{% if tag == 'a' %}
|
|
36
|
+
href="{{ url }}"
|
|
37
|
+
{% if open_in_new_tab %}target="_blank" rel="noopener noreferrer"{% endif %}
|
|
38
|
+
{% else %}
|
|
39
|
+
type="{{ btn_type }}"
|
|
40
|
+
{% if disabled %}disabled{% endif %}
|
|
41
|
+
{% endif %}
|
|
42
|
+
class="rk-btn rk-btn--{{ btn_style }} rk-btn--{{ btn_size }}{% if full_width %} rk-btn--full{% endif %}{% if loading %} rk-btn--loading{% endif %}{% if disabled %} rk-btn--disabled{% endif %}{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
43
|
+
{{ attr }}
|
|
44
|
+
>
|
|
45
|
+
{%- if icon != blank -%}
|
|
46
|
+
<span class="rk-icon rk-icon--sm">{% render 'icon', icon: icon %}</span>
|
|
47
|
+
{%- endif -%}
|
|
48
|
+
<span class="rk-btn__text">{{ text }}</span>
|
|
49
|
+
</{{ tag }}>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkCard
|
|
3
|
+
Container flexível para agrupar conteúdos e ações sobre um único tópico.
|
|
4
|
+
|
|
5
|
+
@param {string} [as] - Tag do container principal (ex: 'div', 'article', 'a'). Padrão: 'div'
|
|
6
|
+
@param {string} [href] - URL caso o card seja um link (exige as: 'a').
|
|
7
|
+
@param {boolean} [interactive] - Se true (ativo por padrão em links), adiciona efeito de hover e focus.
|
|
8
|
+
@param {string} [custom_class] - Classes CSS customizadas para o root.
|
|
9
|
+
@param {string} [header] - HTML para o cabeçalho (título/descrição).
|
|
10
|
+
@param {string} [content] - HTML para o corpo principal (dados/mídias).
|
|
11
|
+
@param {string} [footer] - HTML para o rodapé (ações/metadados).
|
|
12
|
+
|
|
13
|
+
@example
|
|
14
|
+
{% capture card_header %}
|
|
15
|
+
<h3 class="rk-card__title">Título do Card</h3>
|
|
16
|
+
<p class="rk-card__description">Descrição de apoio</p>
|
|
17
|
+
{% endcapture %}
|
|
18
|
+
|
|
19
|
+
{% render 'rk-card',
|
|
20
|
+
as: 'article',
|
|
21
|
+
interactive: true,
|
|
22
|
+
header: card_header,
|
|
23
|
+
content: '<p>Corpo</p>',
|
|
24
|
+
footer: '<button>Ação</button>'
|
|
25
|
+
%}
|
|
26
|
+
{% enddoc %}
|
|
27
|
+
|
|
28
|
+
{%- liquid
|
|
29
|
+
assign t_as = as | default: 'div'
|
|
30
|
+
assign is_link = false
|
|
31
|
+
|
|
32
|
+
if t_as == 'a' and href != blank
|
|
33
|
+
assign is_link = true
|
|
34
|
+
endif
|
|
35
|
+
|
|
36
|
+
# Set interactive state
|
|
37
|
+
assign is_interactive = false
|
|
38
|
+
if interactive == true or interactive == 'true' or is_link
|
|
39
|
+
assign is_interactive = true
|
|
40
|
+
endif
|
|
41
|
+
-%}
|
|
42
|
+
|
|
43
|
+
<{{ t_as }}
|
|
44
|
+
class="rk-card{% if is_interactive %} rk-card--interactive{% endif %}{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
45
|
+
{% if is_link %}href="{{ href }}"{% endif %}
|
|
46
|
+
>
|
|
47
|
+
{%- if header != blank -%}
|
|
48
|
+
<div class="rk-card__header">
|
|
49
|
+
{{ header }}
|
|
50
|
+
</div>
|
|
51
|
+
{%- endif -%}
|
|
52
|
+
|
|
53
|
+
{%- if content != blank -%}
|
|
54
|
+
<div class="rk-card__content">
|
|
55
|
+
{{ content }}
|
|
56
|
+
</div>
|
|
57
|
+
{%- endif -%}
|
|
58
|
+
|
|
59
|
+
{%- if footer != blank -%}
|
|
60
|
+
<div class="rk-card__footer">
|
|
61
|
+
{{ footer }}
|
|
62
|
+
</div>
|
|
63
|
+
{%- endif -%}
|
|
64
|
+
</{{ t_as }}>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Snippet: RkCarousel
|
|
3
|
+
Renders a powerful Slider/Carousel powered by Swiper.js.
|
|
4
|
+
The `<rk-carousel-element>` dynamically loads the library and handles init/destroy lifecycle.
|
|
5
|
+
|
|
6
|
+
@param {string} content - HTML content. MUST yield elements with class `swiper-slide`
|
|
7
|
+
@param {string} [id] - Unique ID
|
|
8
|
+
@param {string} [custom_class] - Extra CSS classes for the root wrapper
|
|
9
|
+
@param {boolean} [show_arrows] - Show previous/next buttons (default: true)
|
|
10
|
+
@param {boolean} [show_pagination] - Show bottom pagination dots (default: true)
|
|
11
|
+
@param {boolean} [loop] - Enable infinite loop
|
|
12
|
+
@param {boolean} [autoplay] - Enable automatic sliding
|
|
13
|
+
@param {number} [autoplay_delay] - Delay between slides in ms for autoplay (default: 3000)
|
|
14
|
+
@param {number} [gap] - Space between slides in pixels (default: 16)
|
|
15
|
+
@param {number} [desktop_items] - Slides to show on desktop >= 768px (default: 3)
|
|
16
|
+
@param {number} [mobile_items] - Slides to show on mobile < 768px (default: 1)
|
|
17
|
+
@param {boolean} [free_mode] - Free scroll mode instead of snap-to-slide
|
|
18
|
+
@param {string} [options_json] - Escaped JSON string for raw Swiper options override
|
|
19
|
+
|
|
20
|
+
@example
|
|
21
|
+
{% capture carousel_slides %}
|
|
22
|
+
<div class="swiper-slide rk-carousel__slide">Slide 1</div>
|
|
23
|
+
<div class="swiper-slide rk-carousel__slide">Slide 2</div>
|
|
24
|
+
{% endcapture %}
|
|
25
|
+
|
|
26
|
+
{% render 'rk-carousel',
|
|
27
|
+
content: carousel_slides,
|
|
28
|
+
show_arrows: true,
|
|
29
|
+
desktop_items: 4,
|
|
30
|
+
loop: true
|
|
31
|
+
%}
|
|
32
|
+
{% enddoc %}
|
|
33
|
+
|
|
34
|
+
{%- liquid
|
|
35
|
+
assign t_show_arrows = show_arrows | default: true, allow_false: true
|
|
36
|
+
assign t_show_pagination = show_pagination | default: true, allow_false: true
|
|
37
|
+
assign t_loop = loop | default: false
|
|
38
|
+
assign t_autoplay = autoplay | default: false
|
|
39
|
+
assign t_gap = gap | default: 16
|
|
40
|
+
assign t_desktop_items = desktop_items | default: 3
|
|
41
|
+
assign t_mobile_items = mobile_items | default: 1
|
|
42
|
+
-%}
|
|
43
|
+
|
|
44
|
+
<rk-carousel-element
|
|
45
|
+
class="rk-carousel{% if custom_class %} {{ custom_class }}{% endif %}"
|
|
46
|
+
{% if id %}id="{{ id }}"{% endif %}
|
|
47
|
+
data-gap="{{ t_gap }}"
|
|
48
|
+
data-desktop-items="{{ t_desktop_items }}"
|
|
49
|
+
data-mobile-items="{{ t_mobile_items }}"
|
|
50
|
+
{% if t_loop %}data-loop="true"{% endif %}
|
|
51
|
+
{% if free_mode %}data-free-mode="true"{% endif %}
|
|
52
|
+
{% if t_autoplay %}
|
|
53
|
+
data-autoplay="true"
|
|
54
|
+
{% if autoplay_delay %}data-autoplay-delay="{{ autoplay_delay }}"{% endif %}
|
|
55
|
+
{% endif %}
|
|
56
|
+
{% if options_json %}data-swiper-options="{{ options_json | escape }}"{% endif %}
|
|
57
|
+
>
|
|
58
|
+
<div class="swiper rk-carousel__swiper">
|
|
59
|
+
<div class="swiper-wrapper rk-carousel__wrapper">
|
|
60
|
+
{{ content }}
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
{%- if t_show_arrows -%}
|
|
64
|
+
<div class="swiper-button-prev rk-carousel__nav rk-carousel__nav--prev"></div>
|
|
65
|
+
<div class="swiper-button-next rk-carousel__nav rk-carousel__nav--next"></div>
|
|
66
|
+
{%- endif -%}
|
|
67
|
+
|
|
68
|
+
{%- if t_show_pagination -%}
|
|
69
|
+
<div class="rk-carousel__pagination-wrapper">
|
|
70
|
+
<div class="swiper-pagination rk-carousel__pagination"></div>
|
|
71
|
+
</div>
|
|
72
|
+
{%- endif -%}
|
|
73
|
+
</div>
|
|
74
|
+
</rk-carousel-element>
|