Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "spec"
require "../src/lucky"
require "../src/html"
require "../tasks/**"
require "./support/**"

Expand Down
2 changes: 1 addition & 1 deletion src/charms/bool_extensions.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../lucky/allowed_in_tags"
require "../lucky/tags/allowed_in_tags"

struct Bool
include ::Lucky::AllowedInTags
Expand Down
2 changes: 1 addition & 1 deletion src/charms/int16_extensions.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../lucky/allowed_in_tags"
require "../lucky/tags/allowed_in_tags"

struct Int16
include ::Lucky::AllowedInTags
Expand Down
2 changes: 1 addition & 1 deletion src/charms/int32_extensions.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../lucky/allowed_in_tags"
require "../lucky/tags/allowed_in_tags"

struct Int32
include ::Lucky::AllowedInTags
Expand Down
2 changes: 1 addition & 1 deletion src/charms/int64_extensions.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../lucky/allowed_in_tags"
require "../lucky/tags/allowed_in_tags"

struct Int64
include ::Lucky::AllowedInTags
Expand Down
9 changes: 9 additions & 0 deletions src/html.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These files are required when any HTML component is used.
# ```
# require "lucky"
# require "lucky/html"
# ```
#
require "./lucky/html/html_page"
require "./lucky/paginator/components/*"
require "./lucky/html/welcome_page"
1 change: 0 additions & 1 deletion src/lucky.cr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ require "./lucky/route_helper"
require "./lucky/*"
require "./lucky/paginator/paginator"
require "./lucky/paginator/*"
require "./lucky/paginator/components/*"

module Lucky
ROUTER = Lucky::Router.new
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/lucky/html_builder.cr → src/lucky/html/html_builder.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "./tags/**"
require "./page_helpers/**"
require "../tags/**"
require "../page_helpers/**"
require "./mount_component"

module Lucky::HTMLBuilder
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/lucky/paginator/components/bootstrap_nav.cr
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
require "../../html/base_component"

# Pagination component using Bootstrap styles
#
# https://getbootstrap.com/docs/4.0/components/pagination/
class Lucky::Paginator::BootstrapNav < Lucky::BaseComponent
needs pages : Lucky::Paginator

@[Deprecated("Consider using Lucky::Paginator::SimpleNav or writing a custom component")]
def render
nav aria_label: "pagination", role: "navigation" do
ul class: "pagination", aria_label: "pagination" do
Expand Down
3 changes: 3 additions & 0 deletions src/lucky/paginator/components/bulma_nav.cr
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
require "../../html/base_component"

# Pagination component using Bulma Pagination styles
#
# https://bulma.io/documentation/components/pagination/
class Lucky::Paginator::BulmaNav < Lucky::BaseComponent
needs pages : Lucky::Paginator

@[Deprecated("Consider using Lucky::Paginator::SimpleNav or writing a custom component")]
Copy link
Contributor

@wout wout Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it an idea to put those front-end framework-specific components in a separate shard? Or maybe just document them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I think just documenting them would be much better. Like recipes if you need. Then adding them into your project is easy and don't have to worry about outdated CSS framework versions.

def render
nav aria_label: "pagination", class: "pagination", role: "navigation" do
ul class: "pagination-list" do
Expand Down
2 changes: 2 additions & 0 deletions src/lucky/paginator/components/simple_nav.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "../../html/base_component"

# Pagination component with raw html and no styling
#
# Typically you would copy paste this component source into your app
Expand Down
File renamed without changes.