rook-cli 1.3.2 → 1.3.5

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.
Files changed (92) hide show
  1. package/package.json +3 -2
  2. package/rook-framework/PRD-INSTALL-COMMAND.md +379 -0
  3. package/rook-framework/PRD.md +1214 -0
  4. package/rook-framework/README.md +143 -0
  5. package/rook-framework/assets/rk-accordion.js +99 -0
  6. package/rook-framework/assets/rk-alert-dialog.js +132 -0
  7. package/rook-framework/assets/rk-bottom-app-bar.js +88 -0
  8. package/rook-framework/assets/rk-carousel.js +145 -0
  9. package/rook-framework/assets/rk-collapsible.js +151 -0
  10. package/rook-framework/assets/rk-dialog.js +161 -0
  11. package/rook-framework/assets/rk-drawer.js +214 -0
  12. package/rook-framework/assets/rk-framework-core.css +2554 -0
  13. package/rook-framework/assets/rk-framework-tokens.css +101 -0
  14. package/rook-framework/assets/rk-modal.js +91 -0
  15. package/rook-framework/assets/rk-popover.js +264 -0
  16. package/rook-framework/assets/rk-progress.js +81 -0
  17. package/rook-framework/assets/rk-quantity.js +91 -0
  18. package/rook-framework/assets/rk-scroll-area.js +286 -0
  19. package/rook-framework/assets/rk-sheet.js +157 -0
  20. package/rook-framework/assets/rk-tabs.js +179 -0
  21. package/rook-framework/assets/rk-toggle.js +153 -0
  22. package/rook-framework/blocks/rk-accordion.liquid +97 -0
  23. package/rook-framework/blocks/rk-badge.liquid +103 -0
  24. package/rook-framework/blocks/rk-button.liquid +166 -0
  25. package/rook-framework/blocks/rk-divider.liquid +100 -0
  26. package/rook-framework/blocks/rk-form-field.liquid +120 -0
  27. package/rook-framework/blocks/rk-icon.liquid +134 -0
  28. package/rook-framework/blocks/rk-image.liquid +198 -0
  29. package/rook-framework/blocks/rk-installments.liquid +99 -0
  30. package/rook-framework/blocks/rk-pix-discount.liquid +99 -0
  31. package/rook-framework/blocks/rk-price.liquid +128 -0
  32. package/rook-framework/blocks/rk-quantity.liquid +108 -0
  33. package/rook-framework/blocks/rk-quick-add.liquid +137 -0
  34. package/rook-framework/blocks/rk-skeleton.liquid +104 -0
  35. package/rook-framework/blocks/rk-typography.liquid +183 -0
  36. package/rook-framework/config/rk-color-scheme-group.json +138 -0
  37. package/rook-framework/config/rk-settings_schema.json +259 -0
  38. package/rook-framework/snippets/rk-accordion.liquid +31 -0
  39. package/rook-framework/snippets/rk-alert-dialog.liquid +83 -0
  40. package/rook-framework/snippets/rk-aspect-ratio.liquid +23 -0
  41. package/rook-framework/snippets/rk-badge.liquid +17 -0
  42. package/rook-framework/snippets/rk-bottom-app-bar.liquid +51 -0
  43. package/rook-framework/snippets/rk-button.liquid +49 -0
  44. package/rook-framework/snippets/rk-card.liquid +64 -0
  45. package/rook-framework/snippets/rk-carousel.liquid +74 -0
  46. package/rook-framework/snippets/rk-checkbox.liquid +34 -0
  47. package/rook-framework/snippets/rk-collapsible.liquid +52 -0
  48. package/rook-framework/snippets/rk-color-schemes-standalone.liquid +61 -0
  49. package/rook-framework/snippets/rk-color-schemes.liquid +43 -0
  50. package/rook-framework/snippets/rk-dialog.liquid +85 -0
  51. package/rook-framework/snippets/rk-divider.liquid +25 -0
  52. package/rook-framework/snippets/rk-drawer.liquid +81 -0
  53. package/rook-framework/snippets/rk-external-assets copy.liquid +33 -0
  54. package/rook-framework/snippets/rk-external-assets.liquid +68 -0
  55. package/rook-framework/snippets/rk-form-field.liquid +83 -0
  56. package/rook-framework/snippets/rk-gap-style.liquid +32 -0
  57. package/rook-framework/snippets/rk-icon.liquid +28 -0
  58. package/rook-framework/snippets/rk-image.liquid +60 -0
  59. package/rook-framework/snippets/rk-input.liquid +35 -0
  60. package/rook-framework/snippets/rk-installments.liquid +54 -0
  61. package/rook-framework/snippets/rk-item.liquid +69 -0
  62. package/rook-framework/snippets/rk-layout-style.liquid +37 -0
  63. package/rook-framework/snippets/rk-modal.liquid +31 -0
  64. package/rook-framework/snippets/rk-pix-discount.liquid +34 -0
  65. package/rook-framework/snippets/rk-popover.liquid +77 -0
  66. package/rook-framework/snippets/rk-price.liquid +48 -0
  67. package/rook-framework/snippets/rk-progress.liquid +38 -0
  68. package/rook-framework/snippets/rk-quantity.liquid +56 -0
  69. package/rook-framework/snippets/rk-quick-add.liquid +67 -0
  70. package/rook-framework/snippets/rk-scripts.liquid +17 -0
  71. package/rook-framework/snippets/rk-scroll-area.liquid +60 -0
  72. package/rook-framework/snippets/rk-sheet.liquid +86 -0
  73. package/rook-framework/snippets/rk-size-style.liquid +48 -0
  74. package/rook-framework/snippets/rk-skeleton.liquid +25 -0
  75. package/rook-framework/snippets/rk-spacing-padding.liquid +18 -0
  76. package/rook-framework/snippets/rk-spacing-style.liquid +54 -0
  77. package/rook-framework/snippets/rk-spinner.liquid +43 -0
  78. package/rook-framework/snippets/rk-swatch.liquid +33 -0
  79. package/rook-framework/snippets/rk-table.liquid +44 -0
  80. package/rook-framework/snippets/rk-tabs.liquid +52 -0
  81. package/rook-framework/snippets/rk-textarea.liquid +42 -0
  82. package/rook-framework/snippets/rk-toggle-group.liquid +27 -0
  83. package/rook-framework/snippets/rk-toggle.liquid +58 -0
  84. package/rook-framework/snippets/rk-typography.liquid +27 -0
  85. package/rook-framework/snippets/rk-variables.liquid +76 -0
  86. package/src/app.js +24 -0
  87. package/src/commands/InstallCommand.js +133 -0
  88. package/src/mcp/server.js +111 -1
  89. package/src/services/FrameworkInstaller.js +485 -0
  90. package/src/templates/block.liquid.txt +0 -15
  91. package/src/ui/PromptUI.js +15 -1
  92. package/src/utils/logger.js +1 -1
@@ -0,0 +1,138 @@
1
+ [
2
+ {
3
+ "name": "Rook UI — Esquema de Cores",
4
+ "settings": [
5
+ {
6
+ "type": "paragraph",
7
+ "content": "Esquemas de cores do Rook UI. Cada seção pode aplicar um esquema diferente nos componentes rk-*."
8
+ },
9
+ {
10
+ "type": "color_scheme_group",
11
+ "id": "rk_color_schemes",
12
+ "definition": [
13
+ {
14
+ "type": "header",
15
+ "content": "Cores de Fundo"
16
+ },
17
+ {
18
+ "type": "color",
19
+ "id": "background",
20
+ "label": "Fundo",
21
+ "default": "#ffffff"
22
+ },
23
+ {
24
+ "type": "color",
25
+ "id": "background_secondary",
26
+ "label": "Fundo Secundário",
27
+ "default": "#f5f5f5",
28
+ "info": "Usado em tabs, toggles, progress track e cards."
29
+ },
30
+ {
31
+ "type": "header",
32
+ "content": "Cores Primárias"
33
+ },
34
+ {
35
+ "type": "color",
36
+ "id": "primary",
37
+ "label": "Cor Primária",
38
+ "default": "#000000",
39
+ "info": "Botões, links e destaques."
40
+ },
41
+ {
42
+ "type": "color",
43
+ "id": "primary_hover",
44
+ "label": "Cor Primária (Hover)",
45
+ "default": "#1a1a1a"
46
+ },
47
+ {
48
+ "type": "color",
49
+ "id": "primary_foreground",
50
+ "label": "Texto sobre Primária",
51
+ "default": "#ffffff",
52
+ "info": "Texto quando o fundo é a cor primária (botões, FAB)."
53
+ },
54
+ {
55
+ "type": "header",
56
+ "content": "Cores Secundárias"
57
+ },
58
+ {
59
+ "type": "color",
60
+ "id": "secondary",
61
+ "label": "Cor Secundária",
62
+ "default": "#ffffff"
63
+ },
64
+ {
65
+ "type": "color",
66
+ "id": "secondary_hover",
67
+ "label": "Cor Secundária (Hover)",
68
+ "default": "#f5f5f5"
69
+ },
70
+ {
71
+ "type": "header",
72
+ "content": "Cores Semânticas"
73
+ },
74
+ {
75
+ "type": "color",
76
+ "id": "success",
77
+ "label": "Cor de Sucesso",
78
+ "default": "#22c55e"
79
+ },
80
+ {
81
+ "type": "color",
82
+ "id": "danger",
83
+ "label": "Cor de Erro / Perigo",
84
+ "default": "#ef4444"
85
+ },
86
+ {
87
+ "type": "header",
88
+ "content": "Texto e Bordas"
89
+ },
90
+ {
91
+ "type": "color",
92
+ "id": "text",
93
+ "label": "Cor do Texto",
94
+ "default": "#1a1a1a"
95
+ },
96
+ {
97
+ "type": "color",
98
+ "id": "text_muted",
99
+ "label": "Texto Secundário",
100
+ "default": "#737373"
101
+ },
102
+ {
103
+ "type": "color",
104
+ "id": "border",
105
+ "label": "Cor da Borda",
106
+ "default": "#e5e5e5"
107
+ },
108
+ {
109
+ "type": "color",
110
+ "id": "ring",
111
+ "label": "Anel de Foco (Focus Ring)",
112
+ "default": "#0f172a",
113
+ "info": "Cor do outline de foco para acessibilidade."
114
+ },
115
+ {
116
+ "type": "color",
117
+ "id": "shadow",
118
+ "label": "Cor da Sombra",
119
+ "default": "#000000",
120
+ "info": "Base para box-shadow de cards, drawers e popovers."
121
+ }
122
+ ],
123
+ "role": {
124
+ "text": "text",
125
+ "background": "background",
126
+ "links": "primary",
127
+ "icons": "text",
128
+ "primary_button": "primary",
129
+ "on_primary_button": "primary_foreground",
130
+ "primary_button_border": "primary",
131
+ "secondary_button": "secondary",
132
+ "on_secondary_button": "primary",
133
+ "secondary_button_border": "border"
134
+ }
135
+ }
136
+ ]
137
+ }
138
+ ]
@@ -0,0 +1,259 @@
1
+ [
2
+ {
3
+ "name": "Rook UI — Cores",
4
+ "settings": [
5
+ {
6
+ "type": "paragraph",
7
+ "content": "Cores globais padrão do Rook UI. Essas cores definem o :root e são usadas quando nenhum esquema de cores é aplicado na seção."
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 }}>