rook-cli 1.3.12 → 1.3.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rook-cli",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "CLI para instalar componentes Shopify",
5
5
  "repository": {
6
6
  "type": "git",
@@ -135,6 +135,7 @@ O framework inteiro vive em `/rook-framework/` como pasta isolada. Para portar p
135
135
  │ ├── rk-collapsible.liquid ← Molécula: Painel ocultável
136
136
  │ ├── rk-carousel.liquid ← Molécula: Slider/Carousel (Swiper.js)
137
137
  │ ├── rk-bottom-app-bar.liquid ← Molécula: Barra de navegação inferior estilo App
138
+ │ ├── rk-group.liquid ← Molécula: Container flexível com controladores completos (layout/size/bg/overlay/border/link)
138
139
  │ ├── rk-external-assets.liquid ← Serviço: Gerenciador de preconnects, CDNs e scripts externos (GSAP/Animejs)
139
140
  │ ├── rk-scripts.liquid ← Serviço: Carregador centralizado dos Web Components JS do framework
140
141
  │ └── rk-quick-add.liquid ← Molécula: Add to Cart (⚠️ exceção)
@@ -152,7 +153,8 @@ O framework inteiro vive em `/rook-framework/` como pasta isolada. Para portar p
152
153
  ├── rk-pix-discount.liquid ← Block: Desconto Pix com customizer
153
154
  ├── rk-quantity.liquid ← Block: Seletor qtd com customizer
154
155
  ├── rk-quick-add.liquid ← Block: Add to Cart com customizer
155
- └── rk-skeleton.liquid ← Block: Skeleton com customizer
156
+ ├── rk-skeleton.liquid ← Block: Skeleton com customizer
157
+ └── rk-group.liquid ← Block: Grupo container com customizer
156
158
  ```
157
159
 
158
160
  ---
@@ -529,20 +531,20 @@ Shapes: `text` \| `circle` \| `rect`
529
531
 
530
532
  ---
531
533
 
532
- #### `rk-modal` (Media Lightbox)
534
+ #### `rk-modal` (Generic Lightbox Container)
533
535
  **Arquivo:** `snippets/rk-modal.liquid`
534
536
  **Controller:** `assets/rk-modal.js` → `<rk-modal-element>`
535
- **Descrição:** Lightbox de mídia especializado para imagens, vídeos hospedados, YouTube, Vimeo e HTML customizado. Suporta lazy-loading de iframes, autoplay, overlay escuro (85% opacidade), ESC key e scroll lock.
537
+ **Descrição:** Container lightbox genérico e fullscreen. Aceita qualquer conteúdo por padrão (type: `custom`) e oferece presets de conveniência para tipos de mídia comuns (image, video, youtube, vimeo, html). Suporta lazy-loading de iframes, autoplay, overlay escuro (85% opacidade), ESC key e scroll lock.
536
538
 
537
539
  | Prop | Tipo | Default | Descrição |
538
540
  |---|---|---|---|
539
541
  | `id` | string | — | ID único do modal (obrigatório) |
540
- | `type` | string | `image` | `image` \| `video` \| `youtube` \| `vimeo` \| `html` |
542
+ | `type` | string | `custom` | `custom` \| `image` \| `video` \| `youtube` \| `vimeo` \| `html` |
543
+ | `content` | string | — | HTML arbitrário (funciona com qualquer type, obrigatório para `custom` e `html`) |
541
544
  | `image` | object | — | Objeto imagem Shopify (para type: `image`) |
542
545
  | `video_url` | string | — | URL do arquivo .mp4 (para type: `video`) |
543
546
  | `youtube_id` | string | — | ID do vídeo YouTube (para type: `youtube`) |
544
547
  | `vimeo_id` | string | — | ID do vídeo Vimeo (para type: `vimeo`) |
545
- | `content` | string | — | HTML customizado (para type: `html`) |
546
548
  | `alt` | string | — | Texto alternativo / aria-label |
547
549
  | `aspect_ratio` | string | `16/9` | Aspect ratio para vídeos |
548
550
  | `autoplay` | boolean | `true` | Autoplay ao abrir |
@@ -552,6 +554,14 @@ Shapes: `text` \| `circle` \| `rect`
552
554
 
553
555
  **Exemplo:**
554
556
  ```liquid
557
+ {%- comment -%} Conteúdo customizado (default) {%- endcomment -%}
558
+ {%- capture modal_body -%}
559
+ <h2>Meu conteúdo</h2>
560
+ <p>Qualquer HTML aqui</p>
561
+ {%- render 'rk-button', text: 'Fechar', attr: 'data-action="close"' -%}
562
+ {%- endcapture -%}
563
+ {% render 'rk-modal', id: 'my-modal', content: modal_body %}
564
+
555
565
  {%- comment -%} Lightbox de imagem {%- endcomment -%}
556
566
  {% render 'rk-modal', id: 'product-zoom', type: 'image', image: product.featured_image, alt: product.title %}
557
567
 
@@ -561,10 +571,14 @@ Shapes: `text` \| `circle` \| `rect`
561
571
  {%- comment -%} Vídeo hospedado {%- endcomment -%}
562
572
  {% render 'rk-modal', id: 'story', type: 'video', video_url: video_source, autoplay: true %}
563
573
 
564
- {%- comment -%} HTML customizado {%- endcomment -%}
565
- {% render 'rk-modal', id: 'custom', type: 'html', content: '<p>Conteúdo aqui</p>' %}
574
+ {%- comment -%} HTML customizado (com bg branco e padding) {%- endcomment -%}
575
+ {% render 'rk-modal', id: 'info', type: 'html', content: '<p>Conteúdo aqui</p>' %}
566
576
  ```
567
577
 
578
+ **Diferença entre `custom` e `html`:**
579
+ - `custom` (default): Container transparente sem styling — o conteúdo controla 100% da aparência.
580
+ - `html`: Container com fundo branco, border-radius e padding — ideal para conteúdo de texto.
581
+
568
582
  **Comportamento Técnico:**
569
583
  - Iframes (YouTube/Vimeo) usam `data-src` para lazy-loading (carregam apenas ao abrir)
570
584
  - YouTube: `https://www.youtube.com/embed/{ID}?rel=0&enablejsapi=1`
@@ -1038,6 +1052,73 @@ Shapes: `text` \| `circle` \| `rect`
1038
1052
 
1039
1053
  ---
1040
1054
 
1055
+ #### `rk-group`
1056
+ **Arquivo:** `snippets/rk-group.liquid`
1057
+ **Controller:** Nenhum (CSS puro + Liquid)
1058
+ **Descrição:** Container flexível ("smart div") que aceita qualquer conteúdo dentro dele com controladores completos para layout, tamanho, espaçamento, fundo (cor/imagem), overlay (sólido/gradiente), borda e link. Compõe internamente os snippets `rk-layout-style`, `rk-size-style` e `rk-spacing-style` para máxima reutilização.
1059
+
1060
+ | Prop | Tipo | Default | Descrição |
1061
+ |---|---|---|---|
1062
+ | `children` | string | — | HTML do conteúdo interno (obrigatório) |
1063
+ | `settings` | object | — | Objeto de configurações do block/section |
1064
+ | `shopify_attributes` | string | — | Atributos do editor Shopify |
1065
+ | `class` | string | — | Classes CSS extras |
1066
+ | `style` | string | — | Estilos inline extras |
1067
+
1068
+ **Settings de Layout:**
1069
+ | Setting | Tipo | Default | Descrição |
1070
+ |---|---|---|---|
1071
+ | `content_direction` | select | `column` | `column` \| `row` |
1072
+ | `vertical_on_mobile` | checkbox | `true` | Empilha no mobile (quando `row`) |
1073
+ | `horizontal_alignment` | select | `flex-start` | Alinhamento horizontal (row) |
1074
+ | `vertical_alignment` | select | `center` | Alinhamento vertical (row) |
1075
+ | `horizontal_alignment_flex_direction_column` | select | `flex-start` | Alinhamento horizontal (column) |
1076
+ | `vertical_alignment_flex_direction_column` | select | `center` | Alinhamento vertical (column) |
1077
+ | `gap` | range | `12px` | Espaço entre itens |
1078
+
1079
+ **Settings de Tamanho:**
1080
+ | Setting | Tipo | Default | Descrição |
1081
+ |---|---|---|---|
1082
+ | `width` | select | `fill` | `fill` \| `fit-content` \| `custom` |
1083
+ | `custom_width` | range | `100%` | Largura personalizada (%) |
1084
+ | `width_mobile` | select | `fill` | Override mobile |
1085
+ | `custom_width_mobile` | range | `100%` | Largura mobile personalizada |
1086
+ | `height` | select | `fit` | `fit` \| `fill` \| `custom` |
1087
+ | `custom_height` | range | `100%` | Altura personalizada (%) |
1088
+
1089
+ **Settings de Aparência:**
1090
+ | Setting | Tipo | Default | Descrição |
1091
+ |---|---|---|---|
1092
+ | `background_color` | color | — | Cor de fundo |
1093
+ | `background_image` | image_picker | — | Imagem de fundo |
1094
+ | `background_image_position` | select | `cover` | `cover` \| `contain` |
1095
+ | `border` | select | `none` | `none` \| `solid` |
1096
+ | `border_width` | range | `1px` | Espessura da borda |
1097
+ | `border_opacity` | range | `100%` | Opacidade da borda |
1098
+ | `border_radius` | range | `0` | Arredondamento |
1099
+ | `toggle_overlay` | checkbox | `false` | Ativar overlay |
1100
+ | `overlay_color` | color (alpha) | `#00000026` | Cor do overlay |
1101
+ | `overlay_style` | select | `solid` | `solid` \| `gradient` |
1102
+ | `gradient_direction` | select | `to top` | Direção do gradiente |
1103
+ | `link` | url | — | Link do grupo inteiro |
1104
+ | `open_in_new_tab` | checkbox | `false` | Abrir em nova aba |
1105
+
1106
+ **Exemplo:**
1107
+ ```liquid
1108
+ {%- capture children %}
1109
+ {% content_for 'blocks' %}
1110
+ {% endcapture %}
1111
+ {% render 'rk-group', children: children, settings: block.settings, shopify_attributes: block.shopify_attributes %}
1112
+ ```
1113
+
1114
+ **Comportamento Técnico:**
1115
+ - Link wrapper usa `position: absolute; inset: 0` com `pointer-events: none` nos filhos, preservando interatividade de `a`, `button`, `input`, `textarea`, `select`
1116
+ - Background image usa `<img>` com `object-fit` (cover/contain) para performance e lazy-loading nativo
1117
+ - Overlay suporta cor sólida ou gradiente linear com transparência
1118
+ - No Design Mode do Shopify, pointer-events são restaurados no conteúdo para permitir edição
1119
+
1120
+ ---
1121
+
1041
1122
  ### 5.3 Serviços
1042
1123
 
1043
1124
  #### `rk-external-assets`
@@ -1083,7 +1164,7 @@ Shapes: `text` \| `circle` \| `rect`
1083
1164
  | `updateButtons()` | Habilita/desabilita botões nos limites |
1084
1165
  | `dispatchChange()` | Emite `rk:quantity:change` com o novo valor |
1085
1166
 
1086
- ### 6.2 `rk-modal.js` → `<rk-modal-element>` (Media Lightbox)
1167
+ ### 6.2 `rk-modal.js` → `<rk-modal-element>` (Generic Lightbox Container)
1087
1168
 
1088
1169
  | Método | Descrição |
1089
1170
  |---|---|
@@ -941,6 +941,12 @@
941
941
  user-select: none;
942
942
  }
943
943
 
944
+ .rk-modal__media--custom {
945
+ max-width: min(90vw, 800px);
946
+ max-height: 90vh;
947
+ overflow-y: auto;
948
+ }
949
+
944
950
  .rk-modal__media--html {
945
951
  background: #fff;
946
952
  border-radius: var(--rk-radius);
@@ -2755,6 +2761,129 @@ a.rk-card {
2755
2761
  will-change: opacity, transform;
2756
2762
  }
2757
2763
 
2764
+ /* --------------------------------------------------------------------------
2765
+ rk-group (Group Container — Smart Div with full controllers)
2766
+ Flexible container that accepts any content with layout, size, spacing,
2767
+ background, overlay, border and link controls.
2768
+ -------------------------------------------------------------------------- */
2769
+ .rk-group {
2770
+ position: relative;
2771
+ display: block;
2772
+ background-color: var(--rk-group-bg, transparent);
2773
+ border-style: var(--rk-group-border-style, none);
2774
+ border-width: var(--rk-group-border-width, 0);
2775
+ border-color: rgb(var(--rk-color-border-rgb, 229 229 229) / var(--rk-group-border-opacity, 1));
2776
+ border-radius: var(--rk-group-radius, 0);
2777
+ overflow: hidden;
2778
+ }
2779
+
2780
+ .rk-group--height-fit {
2781
+ height: auto;
2782
+ }
2783
+
2784
+ .rk-group--height-fill {
2785
+ height: 100%;
2786
+ }
2787
+
2788
+ .rk-group--height-custom {
2789
+ height: var(--rk-height, auto);
2790
+ }
2791
+
2792
+ .rk-group--width-fill {
2793
+ width: 100%;
2794
+ }
2795
+
2796
+ .rk-group--width-fit-content {
2797
+ width: fit-content;
2798
+ }
2799
+
2800
+ .rk-group--width-custom {
2801
+ width: var(--rk-width, auto);
2802
+ }
2803
+
2804
+ @media (max-width: 749px) {
2805
+ .rk-group--width-custom,
2806
+ .rk-group--width-fill {
2807
+ width: var(--rk-width-mobile, var(--rk-width, 100%));
2808
+ }
2809
+ }
2810
+
2811
+ /* Link wrapper — full-bleed clickable area */
2812
+ .rk-group__link {
2813
+ position: absolute;
2814
+ inset: 0;
2815
+ z-index: 1;
2816
+ }
2817
+
2818
+ .rk-group__link ~ .rk-group__content,
2819
+ .rk-group__link ~ .rk-group__media {
2820
+ pointer-events: none;
2821
+ }
2822
+
2823
+ .rk-group__link ~ .rk-group__content :is(a, button, input, textarea, select),
2824
+ .rk-group__link ~ .rk-group__media :is(a, button, input, textarea, select) {
2825
+ pointer-events: auto;
2826
+ }
2827
+
2828
+ .rk-group__link ~ .rk-group__content--design-mode {
2829
+ pointer-events: auto;
2830
+ }
2831
+
2832
+ /* Background media layer */
2833
+ .rk-group__media {
2834
+ position: absolute;
2835
+ inset: 0;
2836
+ z-index: 0;
2837
+ pointer-events: none;
2838
+ }
2839
+
2840
+ .rk-group__bg-image {
2841
+ display: block;
2842
+ width: 100%;
2843
+ height: 100%;
2844
+ }
2845
+
2846
+ .rk-group__bg-image--cover {
2847
+ object-fit: cover;
2848
+ }
2849
+
2850
+ .rk-group__bg-image--contain {
2851
+ object-fit: contain;
2852
+ }
2853
+
2854
+ /* Overlay */
2855
+ .rk-group__overlay {
2856
+ position: absolute;
2857
+ inset: 0;
2858
+ pointer-events: none;
2859
+ }
2860
+
2861
+ .rk-group__overlay--solid {
2862
+ background: var(--rk-group-overlay-color);
2863
+ }
2864
+
2865
+ .rk-group__overlay--gradient {
2866
+ background: linear-gradient(
2867
+ var(--rk-group-overlay-direction, to top),
2868
+ var(--rk-group-overlay-color),
2869
+ var(--rk-group-overlay-color-end, transparent)
2870
+ );
2871
+ }
2872
+
2873
+ /* Content layer */
2874
+ .rk-group__content {
2875
+ position: relative;
2876
+ z-index: 1;
2877
+ min-height: inherit;
2878
+ height: 100%;
2879
+ }
2880
+
2881
+ @media (max-width: 749px) {
2882
+ .rk-group__content--mobile-column {
2883
+ flex-direction: column;
2884
+ }
2885
+ }
2886
+
2758
2887
  /* --------------------------------------------------------------------------
2759
2888
  rk-sr-only (Screen Reader Only utility)
2760
2889
  -------------------------------------------------------------------------- */
@@ -1,9 +1,11 @@
1
1
  /* ==========================================================================
2
- Rook UI Core — Modal Media Lightbox Controller
2
+ Rook UI Core — Modal Lightbox Controller
3
3
  Web Component: <rk-modal-element>
4
4
 
5
- Handles image zoom, hosted video (with custom Instagram-style controls),
6
- YouTube/Vimeo embeds, and raw HTML in a fullscreen lightbox overlay.
5
+ Generic fullscreen lightbox container. Accepts any content by default
6
+ (type: 'custom') and provides convenience presets for media types
7
+ (image, video, youtube, vimeo, html). Includes custom Instagram-style
8
+ video controls for hosted video playback.
7
9
  ========================================================================== */
8
10
 
9
11
  if (!customElements.get('rk-modal-element')) {
@@ -0,0 +1,361 @@
1
+ {% comment %}
2
+ Block: RK Group
3
+ A flexible container that accepts any blocks inside it with full layout,
4
+ sizing, spacing, background, overlay, border and link controls.
5
+ Acts as a "smart div" with all the visual controllers needed.
6
+ {% endcomment %}
7
+
8
+ {%- capture children %}
9
+ {% content_for 'blocks' %}
10
+ {% endcapture %}
11
+
12
+ {% render 'rk-group', children: children, settings: block.settings, shopify_attributes: block.shopify_attributes %}
13
+
14
+ {% schema %}
15
+ {
16
+ "name": "RK | Grupo",
17
+ "tag": null,
18
+ "blocks": [
19
+ {
20
+ "type": "@theme"
21
+ },
22
+ {
23
+ "type": "@app"
24
+ }
25
+ ],
26
+ "settings": [
27
+ {
28
+ "type": "header",
29
+ "content": "Layout"
30
+ },
31
+ {
32
+ "type": "select",
33
+ "id": "content_direction",
34
+ "label": "Direção",
35
+ "options": [
36
+ {
37
+ "value": "column",
38
+ "label": "Vertical"
39
+ },
40
+ {
41
+ "value": "row",
42
+ "label": "Horizontal"
43
+ }
44
+ ],
45
+ "default": "column"
46
+ },
47
+ {
48
+ "type": "checkbox",
49
+ "id": "vertical_on_mobile",
50
+ "label": "Empilhar no mobile",
51
+ "default": true,
52
+ "visible_if": "{{ block.settings.content_direction == 'row' }}"
53
+ },
54
+ {
55
+ "type": "select",
56
+ "id": "horizontal_alignment",
57
+ "label": "Alinhamento horizontal",
58
+ "options": [
59
+ { "value": "flex-start", "label": "Esquerda" },
60
+ { "value": "center", "label": "Centro" },
61
+ { "value": "flex-end", "label": "Direita" },
62
+ { "value": "space-between", "label": "Distribuído" }
63
+ ],
64
+ "default": "flex-start",
65
+ "visible_if": "{{ block.settings.content_direction == 'row' }}"
66
+ },
67
+ {
68
+ "type": "select",
69
+ "id": "vertical_alignment",
70
+ "label": "Alinhamento vertical",
71
+ "options": [
72
+ { "value": "flex-start", "label": "Topo" },
73
+ { "value": "center", "label": "Centro" },
74
+ { "value": "flex-end", "label": "Base" }
75
+ ],
76
+ "default": "center",
77
+ "visible_if": "{{ block.settings.content_direction == 'row' }}"
78
+ },
79
+ {
80
+ "type": "select",
81
+ "id": "horizontal_alignment_flex_direction_column",
82
+ "label": "Alinhamento horizontal",
83
+ "options": [
84
+ { "value": "flex-start", "label": "Esquerda" },
85
+ { "value": "center", "label": "Centro" },
86
+ { "value": "flex-end", "label": "Direita" }
87
+ ],
88
+ "default": "flex-start",
89
+ "visible_if": "{{ block.settings.content_direction != 'row' }}"
90
+ },
91
+ {
92
+ "type": "select",
93
+ "id": "vertical_alignment_flex_direction_column",
94
+ "label": "Alinhamento vertical",
95
+ "options": [
96
+ { "value": "flex-start", "label": "Topo" },
97
+ { "value": "center", "label": "Centro" },
98
+ { "value": "flex-end", "label": "Base" },
99
+ { "value": "space-between", "label": "Distribuído" }
100
+ ],
101
+ "default": "center",
102
+ "visible_if": "{{ block.settings.content_direction == 'column' }}"
103
+ },
104
+ {
105
+ "type": "range",
106
+ "id": "gap",
107
+ "label": "Espaço entre itens",
108
+ "min": 0,
109
+ "max": 100,
110
+ "step": 1,
111
+ "unit": "px",
112
+ "default": 12
113
+ },
114
+ {
115
+ "type": "header",
116
+ "content": "Tamanho"
117
+ },
118
+ {
119
+ "type": "select",
120
+ "id": "width",
121
+ "label": "Largura",
122
+ "options": [
123
+ { "value": "fit-content", "label": "Ajustar ao conteúdo" },
124
+ { "value": "fill", "label": "Preencher" },
125
+ { "value": "custom", "label": "Personalizada" }
126
+ ],
127
+ "default": "fill"
128
+ },
129
+ {
130
+ "type": "range",
131
+ "id": "custom_width",
132
+ "label": "Largura personalizada",
133
+ "min": 0,
134
+ "max": 100,
135
+ "step": 1,
136
+ "unit": "%",
137
+ "default": 100,
138
+ "visible_if": "{{ block.settings.width == 'custom' }}"
139
+ },
140
+ {
141
+ "type": "select",
142
+ "id": "width_mobile",
143
+ "label": "Largura mobile",
144
+ "options": [
145
+ { "value": "fit-content", "label": "Ajustar ao conteúdo" },
146
+ { "value": "fill", "label": "Preencher" },
147
+ { "value": "custom", "label": "Personalizada" }
148
+ ],
149
+ "default": "fill"
150
+ },
151
+ {
152
+ "type": "range",
153
+ "id": "custom_width_mobile",
154
+ "label": "Largura mobile personalizada",
155
+ "min": 0,
156
+ "max": 100,
157
+ "step": 1,
158
+ "unit": "%",
159
+ "default": 100,
160
+ "visible_if": "{{ block.settings.width_mobile == 'custom' }}"
161
+ },
162
+ {
163
+ "type": "select",
164
+ "id": "height",
165
+ "label": "Altura",
166
+ "options": [
167
+ { "value": "fit", "label": "Ajustar ao conteúdo" },
168
+ { "value": "fill", "label": "Preencher" },
169
+ { "value": "custom", "label": "Personalizada" }
170
+ ],
171
+ "default": "fit"
172
+ },
173
+ {
174
+ "type": "range",
175
+ "id": "custom_height",
176
+ "label": "Altura personalizada",
177
+ "min": 0,
178
+ "max": 100,
179
+ "step": 1,
180
+ "unit": "%",
181
+ "default": 100,
182
+ "visible_if": "{{ block.settings.height == 'custom' }}"
183
+ },
184
+ {
185
+ "type": "header",
186
+ "content": "Aparência"
187
+ },
188
+ {
189
+ "type": "color",
190
+ "id": "background_color",
191
+ "label": "Cor de fundo"
192
+ },
193
+ {
194
+ "type": "image_picker",
195
+ "id": "background_image",
196
+ "label": "Imagem de fundo"
197
+ },
198
+ {
199
+ "type": "select",
200
+ "id": "background_image_position",
201
+ "label": "Ajuste da imagem",
202
+ "options": [
203
+ { "value": "cover", "label": "Cobrir" },
204
+ { "value": "contain", "label": "Conter" }
205
+ ],
206
+ "default": "cover",
207
+ "visible_if": "{{ block.settings.background_image != blank }}"
208
+ },
209
+ {
210
+ "type": "select",
211
+ "id": "border",
212
+ "label": "Borda",
213
+ "options": [
214
+ { "value": "none", "label": "Nenhuma" },
215
+ { "value": "solid", "label": "Sólida" }
216
+ ],
217
+ "default": "none"
218
+ },
219
+ {
220
+ "type": "range",
221
+ "id": "border_width",
222
+ "min": 0,
223
+ "max": 10,
224
+ "step": 0.5,
225
+ "unit": "px",
226
+ "label": "Espessura da borda",
227
+ "default": 1,
228
+ "visible_if": "{{ block.settings.border != 'none' }}"
229
+ },
230
+ {
231
+ "type": "range",
232
+ "id": "border_opacity",
233
+ "min": 0,
234
+ "max": 100,
235
+ "step": 1,
236
+ "unit": "%",
237
+ "label": "Opacidade da borda",
238
+ "default": 100,
239
+ "visible_if": "{{ block.settings.border != 'none' }}"
240
+ },
241
+ {
242
+ "type": "range",
243
+ "id": "border_radius",
244
+ "label": "Arredondamento",
245
+ "min": 0,
246
+ "max": 100,
247
+ "step": 1,
248
+ "unit": "px",
249
+ "default": 0
250
+ },
251
+ {
252
+ "type": "checkbox",
253
+ "id": "toggle_overlay",
254
+ "label": "Overlay de fundo"
255
+ },
256
+ {
257
+ "type": "color",
258
+ "id": "overlay_color",
259
+ "label": "Cor do overlay",
260
+ "alpha": true,
261
+ "default": "#00000026",
262
+ "visible_if": "{{ block.settings.toggle_overlay }}"
263
+ },
264
+ {
265
+ "type": "select",
266
+ "id": "overlay_style",
267
+ "label": "Estilo do overlay",
268
+ "options": [
269
+ { "value": "solid", "label": "Sólido" },
270
+ { "value": "gradient", "label": "Gradiente" }
271
+ ],
272
+ "default": "solid",
273
+ "visible_if": "{{ block.settings.toggle_overlay }}"
274
+ },
275
+ {
276
+ "type": "select",
277
+ "id": "gradient_direction",
278
+ "label": "Direção do gradiente",
279
+ "options": [
280
+ { "value": "to top", "label": "Para cima" },
281
+ { "value": "to bottom", "label": "Para baixo" }
282
+ ],
283
+ "default": "to top",
284
+ "visible_if": "{{ block.settings.toggle_overlay and block.settings.overlay_style == 'gradient' }}"
285
+ },
286
+ {
287
+ "type": "header",
288
+ "content": "Link"
289
+ },
290
+ {
291
+ "type": "url",
292
+ "id": "link",
293
+ "label": "Link"
294
+ },
295
+ {
296
+ "type": "checkbox",
297
+ "id": "open_in_new_tab",
298
+ "label": "Abrir em nova aba",
299
+ "default": false
300
+ },
301
+ {
302
+ "type": "header",
303
+ "content": "Espaçamento"
304
+ },
305
+ {
306
+ "type": "range",
307
+ "id": "padding-block-start",
308
+ "label": "Topo",
309
+ "min": 0,
310
+ "max": 100,
311
+ "step": 1,
312
+ "unit": "px",
313
+ "default": 0
314
+ },
315
+ {
316
+ "type": "range",
317
+ "id": "padding-block-end",
318
+ "label": "Base",
319
+ "min": 0,
320
+ "max": 100,
321
+ "step": 1,
322
+ "unit": "px",
323
+ "default": 0
324
+ },
325
+ {
326
+ "type": "range",
327
+ "id": "padding-inline-start",
328
+ "label": "Esquerda",
329
+ "min": 0,
330
+ "max": 100,
331
+ "step": 1,
332
+ "unit": "px",
333
+ "default": 0
334
+ },
335
+ {
336
+ "type": "range",
337
+ "id": "padding-inline-end",
338
+ "label": "Direita",
339
+ "min": 0,
340
+ "max": 100,
341
+ "step": 1,
342
+ "unit": "px",
343
+ "default": 0
344
+ }
345
+ ],
346
+ "presets": [
347
+ {
348
+ "name": "RK | Grupo",
349
+ "category": "Rook UI"
350
+ },
351
+ {
352
+ "name": "RK | Grupo Horizontal",
353
+ "category": "Rook UI",
354
+ "settings": {
355
+ "content_direction": "row",
356
+ "gap": 16
357
+ }
358
+ }
359
+ ]
360
+ }
361
+ {% endschema %}
@@ -0,0 +1,130 @@
1
+ {%- doc -%}
2
+ Snippet: RkGroup
3
+ Renders a flexible container block that accepts any content with full layout,
4
+ sizing, spacing, background, overlay, border and link controls.
5
+ Acts as a "smart div" with all the visual controllers needed.
6
+
7
+ @param {string} children - The DOM content of the group (captured HTML)
8
+ @param {object} settings - The block/section settings object
9
+ @param {string} [shopify_attributes] - Shopify editor attributes string
10
+ @param {string} [class] - Custom CSS classes
11
+ @param {string} [style] - Custom inline styles
12
+
13
+ Settings keys used:
14
+ Layout:
15
+ - content_direction: 'column' | 'row' (default: 'column')
16
+ - vertical_on_mobile: boolean (default: true)
17
+ - horizontal_alignment, vertical_alignment (for row)
18
+ - horizontal_alignment_flex_direction_column, vertical_alignment_flex_direction_column (for column)
19
+ - gap: number (px)
20
+ Size:
21
+ - width: 'fill' | 'fit-content' | 'custom'
22
+ - custom_width: number (%)
23
+ - width_mobile: 'fill' | 'fit-content' | 'custom'
24
+ - custom_width_mobile: number (%)
25
+ - height: 'fit' | 'fill' | 'custom'
26
+ - custom_height: number (%)
27
+ Padding:
28
+ - padding-block-start, padding-block-end, padding-inline-start, padding-inline-end: number (px)
29
+ Appearance:
30
+ - background_color: color
31
+ - background_image: image object
32
+ - background_image_position: 'cover' | 'contain' (default: 'cover')
33
+ - border: 'none' | 'solid'
34
+ - border_width: number (px)
35
+ - border_opacity: number (0-100)
36
+ - border_radius: number (px)
37
+ Overlay:
38
+ - toggle_overlay: boolean
39
+ - overlay_color: color (with alpha)
40
+ - overlay_style: 'solid' | 'gradient'
41
+ - gradient_direction: 'to top' | 'to bottom'
42
+ Link:
43
+ - link: url
44
+ - open_in_new_tab: boolean
45
+
46
+ @example
47
+ {% capture children %}
48
+ {% content_for 'blocks' %}
49
+ {% endcapture %}
50
+ {% render 'rk-group', children: children, settings: block.settings, shopify_attributes: block.shopify_attributes %}
51
+ {%- enddoc -%}
52
+
53
+ <div
54
+ class="
55
+ rk-group
56
+ rk-group--height-{{ settings.height | default: 'fit' }}
57
+ rk-group--width-{{ settings.width | default: 'fill' }}
58
+ rk-spacing-style
59
+ rk-size-style
60
+ {{ class }}
61
+ "
62
+ style="
63
+ {% render 'rk-spacing-style', settings: settings %}
64
+ {% render 'rk-size-style', settings: settings %}
65
+ {%- if settings.border != 'none' and settings.border != blank -%}
66
+ --rk-group-border-width: {{ settings.border_width | default: 1 }}px;
67
+ --rk-group-border-style: {{ settings.border }};
68
+ --rk-group-border-opacity: {{ settings.border_opacity | default: 100 | divided_by: 100.0 }};
69
+ {%- endif -%}
70
+ {%- if settings.border_radius != blank and settings.border_radius > 0 -%}
71
+ --rk-group-radius: {{ settings.border_radius }}px;
72
+ {%- endif -%}
73
+ {%- if settings.background_color != blank -%}
74
+ --rk-group-bg: {{ settings.background_color }};
75
+ {%- endif -%}
76
+ {{ style }}
77
+ "
78
+ {{ shopify_attributes }}
79
+ >
80
+ {%- if settings.link != blank -%}
81
+ <a
82
+ href="{{ settings.link }}"
83
+ class="rk-group__link"
84
+ {% if settings.open_in_new_tab %}target="_blank" rel="noopener"{% endif %}
85
+ ></a>
86
+ {%- endif -%}
87
+
88
+ {%- if settings.background_image != blank or settings.toggle_overlay -%}
89
+ <div class="rk-group__media">
90
+ {%- if settings.background_image != blank -%}
91
+ {%- assign bg_position = settings.background_image_position | default: 'cover' -%}
92
+ <img
93
+ src="{{ settings.background_image | image_url: width: 1920 }}"
94
+ alt=""
95
+ loading="lazy"
96
+ class="rk-group__bg-image rk-group__bg-image--{{ bg_position }}"
97
+ width="{{ settings.background_image.width }}"
98
+ height="{{ settings.background_image.height }}"
99
+ >
100
+ {%- endif -%}
101
+
102
+ {%- if settings.toggle_overlay -%}
103
+ {%- assign overlay_color = settings.overlay_color | default: '#00000026' -%}
104
+ {%- assign overlay_style = settings.overlay_style | default: 'solid' -%}
105
+ <div
106
+ class="rk-group__overlay rk-group__overlay--{{ overlay_style }}"
107
+ style="
108
+ --rk-group-overlay-color: {{ overlay_color }};
109
+ --rk-group-overlay-color-end: {{ overlay_color | color_modify: 'alpha', 0 }};
110
+ {%- if overlay_style == 'gradient' -%}
111
+ --rk-group-overlay-direction: {{ settings.gradient_direction | default: 'to top' }};
112
+ {%- endif -%}
113
+ "
114
+ ></div>
115
+ {%- endif -%}
116
+ </div>
117
+ {%- endif -%}
118
+
119
+ <div
120
+ class="
121
+ rk-group__content
122
+ rk-layout-style
123
+ {% if request.design_mode %}rk-group__content--design-mode{% endif %}
124
+ {% if settings.vertical_on_mobile and settings.content_direction == 'row' %} rk-group__content--mobile-column{% endif %}
125
+ "
126
+ style="{% render 'rk-layout-style', settings: settings %}"
127
+ >
128
+ {{- children -}}
129
+ </div>
130
+ </div>
@@ -1,20 +1,29 @@
1
1
  {% doc %}
2
2
  Snippet: RkModal
3
- Renders a media lightbox for images, videos, and embedded content.
3
+ Generic fullscreen lightbox container. Accepts any content by default (type: 'custom')
4
+ and provides convenience presets for common media types (image, video, youtube, vimeo, html).
4
5
  Uses Web Component <rk-modal-element> for behaviour.
5
6
  Videos use custom Instagram-style controls (autoplay + muted by default).
6
7
 
7
8
  @param {string} id - Unique modal id (required)
8
- @param {string} [type] - 'image' | 'video' | 'youtube' | 'vimeo' | 'html' (default: 'image')
9
+ @param {string} [type] - 'custom' | 'image' | 'video' | 'youtube' | 'vimeo' | 'html' (default: 'custom')
10
+ @param {string} [content] - Arbitrary HTML content (works with any type, required for 'custom' and 'html')
9
11
  @param {object} [image] - Shopify image object (when type is 'image')
10
12
  @param {string} [video_url] - Video URL for hosted .mp4 (when type is 'video')
11
13
  @param {string} [youtube_id] - YouTube video ID (when type is 'youtube')
12
14
  @param {string} [vimeo_id] - Vimeo video ID (when type is 'vimeo')
13
- @param {string} [content] - Raw HTML content (when type is 'html')
14
15
  @param {string} [alt] - Alt text for images / aria-label for media
15
16
  @param {string} [aspect_ratio] - Aspect ratio for video (e.g. '16/9', default: '16/9')
16
17
  @param {string} [custom_class] - Extra CSS classes
17
18
 
19
+ @example — Custom content (default)
20
+ {% capture modal_body %}
21
+ <h2>Meu conteúdo</h2>
22
+ <p>Qualquer HTML aqui</p>
23
+ {% render 'rk-button', text: 'Fechar', attr: 'data-action="close"' %}
24
+ {% endcapture %}
25
+ {% render 'rk-modal', id: 'my-modal', content: modal_body %}
26
+
18
27
  @example — Image lightbox
19
28
  {% render 'rk-modal', id: 'product-zoom', type: 'image', image: product.featured_image, alt: product.title %}
20
29
 
@@ -26,7 +35,7 @@
26
35
  {% enddoc %}
27
36
 
28
37
  {%- liquid
29
- assign modal_type = type | default: 'image'
38
+ assign modal_type = type | default: 'custom'
30
39
  assign modal_aspect = aspect_ratio | default: '16/9'
31
40
  assign modal_alt = alt | default: ''
32
41
  -%}
@@ -44,7 +53,7 @@
44
53
  {% render 'rk-icon', icon: 'close', size: 'md', color: '#fff' %}
45
54
  </button>
46
55
 
47
- {%- comment -%} Media content {%- endcomment -%}
56
+ {%- comment -%} Content {%- endcomment -%}
48
57
  <div
49
58
  class="rk-modal__content"
50
59
  role="dialog"
@@ -53,6 +62,11 @@
53
62
  >
54
63
  {%- case modal_type -%}
55
64
 
65
+ {%- when 'custom' -%}
66
+ <div class="rk-modal__media rk-modal__media--custom">
67
+ {{ content }}
68
+ </div>
69
+
56
70
  {%- when 'image' -%}
57
71
  {%- if image != blank -%}
58
72
  {%- assign img_alt = modal_alt | default: image.alt | escape -%}
@@ -59,7 +59,7 @@ export class Logger {
59
59
  console.log(bold(white(' ██║ ██║╚██████╔╝╚██████╔╝██║ ██╗')));
60
60
  console.log(bold(white(' ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')));
61
61
  console.log('');
62
- console.log(dim(' v1.3.12Shopify Component Tool'));
62
+ console.log(dim(' v1.3.14Rook UI'));
63
63
  console.log('');
64
64
  }
65
65