Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next version bump #1568

Merged
merged 42 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7bd6207
style(list): update sortable interaction styles
philschanely Aug 1, 2022
7e3d76f
feat(list): update list interaction (rails)
philschanely Aug 1, 2022
b15e6b3
feat(list): update list interaction (react)
philschanely Aug 1, 2022
415e4f5
style(lists): ensure older lists styles don't conflict with new list
philschanely Aug 1, 2022
e9c76d7
feat(list): wip adding advanced drag features
philschanely Aug 12, 2022
86c23e8
chore(list): convert button handle back to just icon
philschanely Aug 15, 2022
6b6f0ff
feat(list): add fallback and improved documentation
philschanely Aug 16, 2022
27237c5
feat(lsit): cleanup
philschanely Aug 17, 2022
9cc8253
feat(list): remove `hide_first_border` property that is no longer needed
philschanely Aug 17, 2022
c98ad63
chore(list): clean up linting and documentation exception
philschanely Aug 17, 2022
608e608
chore(list): clean up from feedback
philschanely Aug 18, 2022
f221a8b
fix(page-heading): adjust proptypes for more conventional React node …
philschanely Aug 18, 2022
8d6395e
chore(page-heading): remove unused import
philschanely Aug 18, 2022
9bf795c
fix(page-heading): update the name of props along with proptypes and …
philschanely Aug 18, 2022
ed0770a
fix(pagination): adjust default value for pageCount and add documenta…
philschanely Aug 17, 2022
a245e9e
fix(security): addresses vulnerability identified by snyk
kajabi-bot Aug 1, 2022
df394d9
chore(security): update babel/present-env to latest version 7.18.10
kajabi-bot Aug 22, 2022
c9c5902
fix(security): add override for path parse
kajabi-bot Aug 22, 2022
1e1e551
fix(lint): linting errors due to upgrade of dependencies
kajabi-bot Aug 22, 2022
f2f43db
feat(list): adjust handle affordance for clarity
philschanely Aug 22, 2022
d677c8a
chore: lint
philschanely Aug 22, 2022
14c6be0
chore(list): clean up from feedback
philschanely Aug 23, 2022
f1fcdb2
fix(icon): add null empty icon
goodwinchris Aug 23, 2022
62c7bf1
chore: adjust from feedback
philschanely Aug 23, 2022
71a5a82
Merge pull request #1541 from Kajabi/SAGE-535/pjs-sortable-list-inter…
philschanely Aug 23, 2022
9a04418
Merge pull request #1567 from Kajabi/SAGE-754/cg_add-null-icon
goodwinchris Aug 24, 2022
4a0bf65
Merge pull request #1540 from Kajabi/SAGE-421/snyk-lodash-vulnerability
ju-Skinner Aug 24, 2022
5640db4
feat(modal): adds prop for size based on container options
anechol Aug 23, 2022
b33e01d
feat(modal): adds size prop to React component
anechol Aug 24, 2022
75b85c8
Merge pull request #1569 from Kajabi/SAGE-753/ae-modal-size-mod
Aug 25, 2022
47e172d
Merge pull request #1562 from Kajabi/SAGE-752/pjs-pageheading-proptypes
philschanely Aug 25, 2022
31986ba
chore(pagination): improve logic and documentation
philschanely Aug 25, 2022
e249833
chore(pagination): further improve logic and documentation
philschanely Aug 25, 2022
771fa7a
fix(error): error occurring locally with PropTypes.object()
kajabi-bot Aug 25, 2022
cbeedca
Merge pull request #1571 from Kajabi/hotfix/error-with-proptypes_object
ju-Skinner Aug 25, 2022
36b7e61
Merge pull request #1561 from Kajabi/SAGE-751/pjs-pagination-calculat…
philschanely Aug 26, 2022
e9200bb
fix(grid): modify grid helper output, removing duplicate classes
teenwolfblitzer Aug 18, 2022
537cc26
refactor(grid col): refactor helper logic, add comments
teenwolfblitzer Aug 19, 2022
70f4bab
Merge pull request #1566 from Kajabi/SAGE-780_grid_helper_breakpoint_…
teenwolfblitzer Aug 29, 2022
47ecbb9
fix(sidebar): removes border-right from sidebar
pixelflips Aug 22, 2022
4c01236
fix(_content.scss): removed background color
pixelflips Aug 22, 2022
1cbce40
Merge pull request #1565 from Kajabi/SAGE-740_pl-super-admin-sidebar-…
pixelflips Aug 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/app/views/examples/components/icon/_props.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
</tr>
<tr>
<td><%= md('`icon`') %><%= sage_component SageBadge, { color: "published", value: "required" } %></td>
<td><%= md('Which icon to display. See Sage Icons under "Design."') %></td>
<td><%= md('
Which icon to display. See Sage Icons under "Figma Design."
Note: `null` is also available to place an empty space icon
') %></td>
<td><%= md('`String` for desired icon.') %></td>
<td><%= md('--') %></td>
</tr>
Expand Down
63 changes: 49 additions & 14 deletions docs/app/views/examples/components/list/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,76 @@ sample_products = [

<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Default configuration</h3>
<%= md("
SageList is implemented most simply by passing the desired contents for the items through the `SageList` `items` property.
This assumes that the contents of the list are already formatted as desired.
`SageList` is implemented most simply by passing the desired contents for the items through the `SageList` `items` property.
This assumes that the contents of the list are already formatted as desired or you're outputting simple content values.
", use_sage_type: true) %>

<%= sage_component SageList, {
items: sample_products.map { | item | {
content: "Item #{item[:name]}",
id: "example-default-item-#{item[:id]}",
more_actions: { items: dropdown_items(item[:id]) },
}
},
} %>

<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Sortable configuration</h3>
<%= md("
Sortable lists can be created with `SageList` by adding `sortable: true` and a `sortable_resource`.
You can also pass a `sortable_update_url` for sorting callbacks to items
that will be called after the user finishes sorting an item.
", use_sage_type: true) %>

<%= sage_component SageList, {
sortable: true,
sortable_resource: "sample_products",
items: sample_products.map { | item | {
content: %(
<h4>Item #{item[:name]}</h4>
<p>Item #{item[:id]} specs</p>
).html_safe,
id: item[:id],
content: "Item #{item[:name]}",
id: "example-sortable-item-#{item[:id]}",
more_actions: { items: dropdown_items(item[:id]) },
sortable: true,
sortable_update_url: "#sortable-update-url?item=#{item[:id]}",
}
}
},
} %>

<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Fully draggable row</h3>
<%= md('
By default only the drag handle is active for dragging/sorting a row.
However, `drag_handle_type` can be set to `"row"` in order to allow the whole row to be draggable instead.
', use_sage_type: true) %>

<%= sage_component SageList, {
sortable: true,
sortable_resource: "sample_products_2",
items: sample_products.map { | item | {
content: "Item #{item[:name]}",
id: "example-fully-draggable-item-#{item[:id]}",
more_actions: { items: dropdown_items(item[:id]) },
sortable_update_url: "#sortable-update-url?item=#{item[:id]}",
}},
drag_handle_type: "row",
} %>

<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Compositional approach</h3>
<%= md("
If you need more native content formatting you can instead opt to render items using a nested loop and the SageListItem component.
If you need more native content formatting you can instead opt to render items using a nested loop and the `SageListItem` component.
Note that this example also implements the [Reveal utility class](#{pages_helpers_path(:reveal)}).
", use_sage_type: true) %>

<%= sage_component SageList, { sortable_resource: "sample_products_2" } do %>
<%= sage_component SageList, {
sortable: true,
sortable_resource: "sample_products_3",
drag_handle_type: "row",
} do %>
<% sample_products.each do | item | %>
<%= sage_component SageListItem, {
id: item[:id],
id: "example-default-item-#{item[:id]}",
more_actions: { items: dropdown_items(item[:id]) },
sortable: true,
sortable_update_url: "#sortable-update-url?item={item[:id]}",
css_classes: SageClassnames::REVEAL_CONTAINER,
} do %>
<%= sage_component SageCardRow, { grid_template: "ete" } do %>
<img src="//source.unsplash.com/random/240x160?v=<%= item[:id] %>" width="100" alt="" />
<img src="https://source.unsplash.com/random/240x160?v=<%= item[:id] %>" width="64" alt="" />
<%= sage_component SageCardBlock, {} do %>
<h4><%= item[:name] %></h4>
<p>Item <%= item[:id] %> specs</p>
Expand Down
15 changes: 9 additions & 6 deletions docs/app/views/examples/components/list/_props.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@
<td><%= md('See schema for `SageListItem` below.') %></td>
<td><%= md('`[]`') %></td>
</tr>
<tr>
<td><%= md('`drag_handle_type`') %></td>
<td><%= md('
By default only the drag handle is active for dragging/sorting a row.
However, `drag_handle_type` can be set to `"row"` in order to allow the whole row to be draggable instead.
') %></td>
<td><%= md('`"default"` | `"row"` ') %></td>
<td><%= md('`"default"`') %></td>
</tr>
<tr>
<td><%= md('`sortable_resource`') %></td>
<td><%= md('Provide the resource name for a sortable list. Required only when `sortable` is activated for any child items') %></td>
<td><%= md('String') %></td>
<td><%= md('`nil`') %></td>
</tr>
<tr>
<td><%= md('`hide_first_border`') %></td>
<td><%= md('Removes top border from first list item within a SageList') %></td>
<td><%= md('Boolean') %></td>
<td><%= md('`false`') %></td>
</tr>
<tr>
<td colspan="4">
<%= md("**SageListItem**") %>
Expand Down
43 changes: 43 additions & 0 deletions docs/app/views/examples/components/modal/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
"data-js-modaltrigger": "cool-modal-large",
}
} %>
<%= sage_component SageButton, {
style: "primary",
icon: { name: "launch", style: "right" },
value: "Modal with Size Option",
attributes: {
"data-js-modaltrigger": "cool-modal-size-option",
}
} %>
<%= sage_component SageButton, {
style: "primary",
icon: { name: "launch", style: "right" },
Expand Down Expand Up @@ -262,6 +270,41 @@
<% end %>
<% end %>
<% end %>

<%# Standard Modal with Size Option %>
<%= sage_component SageModal, { id: "cool-modal-size-option", size: "full" } do %>
<%= sage_component SageModalContent, {
title: "Example Modal"
} do %>
<% content_for :sage_header_aside do %>
<%= sage_component SageButton, {
style: "secondary",
subtle: true,
value: "Close Modal",
icon: { name: "remove", style: "only" },
attributes: { "data-js-modal": true }
} %>
<% end %>

<%= sample_body_text %>

<% content_for :sage_footer do %>
<% content_for :sage_footer_aside do %>
<%= sage_component SageButton, {
style: "secondary",
subtle: true,
value: "Close Modal",
attributes: { "data-js-modal": true }
} %>
<% end %>
<%= sage_component SageButton, {
style: "primary",
icon: { name: "check", style: "left" },
value: "Take An Action",
} %>
<% end %>
<% end %>
<% end %>
<%# Large Modal %>
<%= sage_component SageModal, {
id: "cool-modal-large",
Expand Down
34 changes: 34 additions & 0 deletions docs/lib/sage_rails/app/helpers/sage_grid_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module SageGridHelper
def grid_column_classes(col)
column_classes = ""

if col.breakpoint.present? && col.size.present?
# if both breakpoint and sizing are provided
column_classes << "sage-col--#{col.breakpoint}-#{col.size} "
elsif !col.breakpoint.present? && col.size.present?
# or if only a size is provided, without a breakpoint
column_classes << "sage-col-#{col.size} "
elsif !col.breakpoint.present? && !col.size.present? && grid_col_legacy(col)
# or if a legacy individual breakpoint is provided
grid_col_breakpoint_individual(col, column_classes)
else
# otherwise we display a default unsized column
column_classes << "sage-col "
end

column_classes << col.generated_css_classes
end

private

def grid_col_legacy(col)
col.xlarge.present? || col.large.present? || col.medium.present? || col.small.present?
end

def grid_col_breakpoint_individual(col, column_classes)
column_classes << "sage-col--xl-#{col.xlarge} " if col.xlarge.present?
column_classes << "sage-col--lg-#{col.large} " if col.large.present?
column_classes << "sage-col--md-#{col.medium} " if col.medium.present?
column_classes << "sage-col--sm-#{col.small} " if col.small.present?
end
end
3 changes: 2 additions & 1 deletion docs/lib/sage_rails/app/sage_components/sage_modal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class SageModal < SageComponent
id: [:optional, NilClass, String],
large: [:optional, TrueClass],
remove_content_on_close: [:optional, TrueClass],
remote_url: [:optional, String]
remote_url: [:optional, String],
size: [:optional, Set.new(SageTokens::CONTAINER_SIZES)]
})
end
4 changes: 2 additions & 2 deletions docs/lib/sage_rails/app/sage_tokens/sage_schemas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ module SageSchemas
LIST_ITEM = {
id: [:optional, Integer, String],
more_actions: [:optional, NilClass, SageSchemas::DROPDOWN],
sortable: [:optional, NilClass, TrueClass],
sortable_update_url: [:optional, NilClass, String],
}

LIST = {
drag_handle_type: [:optional, NilClass, Set.new(["default", "row"])],
items: [:optional, [[SageSchemas::LIST_ITEM]]],
sortable: [:optional, NilClass, TrueClass],
sortable_resource: [:optional, NilClass, String],
tag: [:optional, NilClass, Set.new(["ul", "ol"])],
hide_first_border: [:optional, TrueClass, String],
}

PANEL_FIGURE = {
Expand Down
1 change: 1 addition & 0 deletions docs/lib/sage_rails/app/sage_tokens/sage_tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def SageTokens.grid_templates
"move-right",
"multi-pay",
"newsletter",
"null",
"one-off-session",
"one-time",
"package",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
<% has_infix = component.breakpoint || component.size || component.small || component.medium || component.large %>

<div class="
<%= "sage-col" if !has_infix -%>
<%= "sage-col-#{component.size}" if component.size -%>
<%= "sage-col--#{component.breakpoint}-#{component.size}" if component.breakpoint && component.size -%>
<%= "sage-col--sm-#{component.small}" if component.small%>
<%= "sage-col--md-#{component.medium}" if component.medium%>
<%= "sage-col--lg-#{component.large}" if component.large%>
<%= "sage-col--xl-#{component.xlarge}" if component.xlarge%>
<%= component.generated_css_classes %>
" <%= component.generated_html_attributes.html_safe %>>
<div class="<%= grid_column_classes(component) %>" <%= component.generated_html_attributes.html_safe %>>
<%= component.content %>
</div>
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<%
tag = component.tag.present? ? component.tag : "ul"
tag = component.sortable ? "ol" : "ul"
tag = component.tag || tag
drag_handle_type = component.drag_handle_type.present? ? component.drag_handle_type : "default"
%>
<<%= tag %>
class="
sage-list
<%= component.generated_css_classes %>
<%= "sage-list--hide-first-border" if component.hide_first_border %>
<%= "sage-list--sortable" if component.sortable %>
<%= "sage-list--draggable-by-row" if drag_handle_type == "row" %>
"
<%= "data-js-list-sortable=#{component.sortable_resource}" if component.sortable_resource.present? %>
<%= component.generated_html_attributes.html_safe %>
Expand All @@ -15,6 +18,5 @@ tag = component.tag.present? ? component.tag : "ul"
<%= sage_component SageListItem, item_configs %>
<% end %>
<% end %>

<%= component.content %>
</<%= tag %>>
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ end
<li
class="
sage-list__item
<%= "sage-list__item--sortable" if component.sortable %>
<%= component.generated_css_classes %>
"
<%= "data-js-list-sortable-update-url=#{component.sortable_update_url}" if component.sortable_update_url.present? %>
<%= "id=#{component.id}" if component.id %>
<%= component.generated_html_attributes.html_safe %>
>
<% if component.sortable %>
<div class="sage-list__item-sortable-handle">
<%= sage_component SageIcon, { icon: "handle" } %>
</div>
<% end %>
<div class="sage-list__item-sortable-handle">
<%= sage_component SageIcon, { icon: "handle-2-vertical" } %>
</div>

<div class="sage-list__item-content">
<%= component.content %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<%= "sage-modal--no-blur" if component.disable_background_blur -%>
<%= "sage-modal--no-background-dismiss" if component.disable_background_dismiss -%>
<%= "sage-modal--scrollable" if component.allow_scroll %>
<%= "sage-modal--size-#{component.size}" if component.size %>
<%= component.generated_css_classes %>
"
<%= "data-sage-animate" if component.animate.present? %>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@commitlint/config-conventional": "^11.0.0",
"commitizen": "^4.2.2",
"dotenv": "8.2.0",
"eslint": "^7.10.0",
"eslint": "7.32.0",
"handlebars": "^4.7.7",
"lerna": "^3.22.1",
"lodash": "^4.17.21",
Expand Down
Loading