Skip to content

Commit 4b55a11

Browse files
committed
Bug fixes, improvements, and refresh config UI
1 parent 04e21a0 commit 4b55a11

545 files changed

Lines changed: 10426 additions & 10140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/assets/builds/railsui/application.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/builds/railsui/application.js

Lines changed: 139 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60731,6 +60731,63 @@
6073160731
};
6073260732
__publicField(scroll_controller_default, "targets", ["scrollitem", "launcher"]);
6073360733

60734+
// app/javascript/controllers/scroll_spy_controller.js
60735+
var scroll_spy_controller_default = class extends Controller {
60736+
connect() {
60737+
if (this.hasScrollContainerTarget) {
60738+
this.scrollHandler = this.scrollHandler.bind(this);
60739+
this.scrollContainerTarget.addEventListener("scroll", this.scrollHandler);
60740+
}
60741+
}
60742+
disconnect() {
60743+
this.scrollContainerTarget.removeEventListener("scroll", this.scrollHandler);
60744+
}
60745+
scrollHandler() {
60746+
const scrollPosition = this.scrollContainerTarget.scrollTop;
60747+
this.linkTargets.forEach((link) => {
60748+
const targetId = link.getAttribute("href");
60749+
if (!targetId) {
60750+
return;
60751+
}
60752+
const targetElement = document.querySelector(targetId);
60753+
if (targetElement) {
60754+
const targetPosition = targetElement.offsetTop;
60755+
const targetHeight = targetElement.offsetHeight;
60756+
if (scrollPosition >= targetPosition && scrollPosition < targetPosition + targetHeight) {
60757+
this.activateLink(link);
60758+
} else {
60759+
this.deactivateLink(link);
60760+
}
60761+
}
60762+
});
60763+
}
60764+
activateLink(link) {
60765+
const activeClasses = this.activeClassValue.split(" ");
60766+
activeClasses.forEach((className) => {
60767+
link.classList.add(className);
60768+
});
60769+
const inactiveClasses = this.inactiveClassValue.split(" ");
60770+
inactiveClasses.forEach((className) => {
60771+
link.classList.remove(className);
60772+
});
60773+
}
60774+
deactivateLink(link) {
60775+
const activeClasses = this.activeClassValue.split(" ");
60776+
activeClasses.forEach((className) => {
60777+
link.classList.remove(className);
60778+
});
60779+
const inactiveClasses = this.inactiveClassValue.split(" ");
60780+
inactiveClasses.forEach((className) => {
60781+
link.classList.add(className);
60782+
});
60783+
}
60784+
};
60785+
__publicField(scroll_spy_controller_default, "targets", ["link", "scrollContainer"]);
60786+
__publicField(scroll_spy_controller_default, "values", {
60787+
activeClass: String,
60788+
inactiveClass: String
60789+
});
60790+
6073460791
// app/javascript/controllers/search_controller.js
6073560792
var search_controller_default = class extends Controller {
6073660793
currentResults = this.resultListTarget.innerHTML;
@@ -60774,13 +60831,88 @@
6077460831
var smooth_controller_default = class extends Controller {
6077560832
scroll(event) {
6077660833
event.preventDefault();
60777-
let item = event.currentTarget.hash;
60778-
let target = document.querySelector(item);
60779-
target.scrollIntoView({
60780-
behavior: "smooth"
60781-
});
60834+
const target = document.querySelector(event.currentTarget.hash);
60835+
if (target) {
60836+
target.scrollIntoView({ behavior: "smooth" });
60837+
const href = event.currentTarget.getAttribute("href");
60838+
if (href) {
60839+
history.pushState({}, "", href);
60840+
}
60841+
}
60842+
}
60843+
};
60844+
60845+
// app/javascript/controllers/snippet_controller.js
60846+
var snippet_controller_default = class extends Controller {
60847+
ACTIVE_CLASSES = [
60848+
"bg-white",
60849+
"px-3",
60850+
"py-1.5",
60851+
"rounded-md",
60852+
"shadow",
60853+
"flex",
60854+
"items-center",
60855+
"justify-center",
60856+
"gap-2",
60857+
"text-[13px]",
60858+
"font-semibold",
60859+
"focus:ring-4",
60860+
"focus:ring-blue-600",
60861+
"group",
60862+
"dark:bg-neutral-800/90",
60863+
"dark:text-neutral-100",
60864+
"dark:focus:ring-blue-600/50",
60865+
"dark:text-neutral-300"
60866+
];
60867+
INACTIVE_CLASSES = [
60868+
"bg-transparent",
60869+
"px-3",
60870+
"py-1.5",
60871+
"rounded-md",
60872+
"shadow-none",
60873+
"flex",
60874+
"items-center",
60875+
"justify-center",
60876+
"gap-2",
60877+
"text-[13px]",
60878+
"font-semibold",
60879+
"dark:text-neutral-300"
60880+
];
60881+
togglePreview(event) {
60882+
event.preventDefault();
60883+
this.toggle("preview");
60884+
}
60885+
toggleCode(event) {
60886+
event.preventDefault();
60887+
this.toggle("code");
60888+
}
60889+
toggle(target) {
60890+
const activeClasses = this.ACTIVE_CLASSES;
60891+
const inactiveClasses = this.INACTIVE_CLASSES;
60892+
if (target === "preview") {
60893+
if (!this.previewTarget.classList.contains("hidden")) {
60894+
return;
60895+
}
60896+
this.previewTarget.classList.toggle("hidden");
60897+
this.codeTarget.classList.add("hidden");
60898+
this.previewBtnTarget.className = "";
60899+
this.codeBtnTarget.className = "";
60900+
activeClasses.forEach((cls) => this.previewBtnTarget.classList.add(cls));
60901+
inactiveClasses.forEach((cls) => this.codeBtnTarget.classList.add(cls));
60902+
} else if (target === "code") {
60903+
if (!this.codeTarget.classList.contains("hidden")) {
60904+
return;
60905+
}
60906+
this.codeTarget.classList.toggle("hidden");
60907+
this.previewTarget.classList.add("hidden");
60908+
this.previewBtnTarget.className = "";
60909+
this.codeBtnTarget.className = "";
60910+
activeClasses.forEach((cls) => this.codeBtnTarget.classList.add(cls));
60911+
inactiveClasses.forEach((cls) => this.previewBtnTarget.classList.add(cls));
60912+
}
6078260913
}
6078360914
};
60915+
__publicField(snippet_controller_default, "targets", ["preview", "previewBtn", "code", "codeBtn"]);
6078460916

6078560917
// app/javascript/controllers/tabs_controller.js
6078660918
var tabs_controller_default = class extends Controller {
@@ -60889,9 +61021,11 @@
6088961021
application.register("nav", nav_controller_default);
6089061022
application.register("prevent", prevent_controller_default);
6089161023
application.register("scroll", scroll_controller_default);
61024+
application.register("scroll-spy", scroll_spy_controller_default);
6089261025
application.register("search", search_controller_default);
6089361026
application.register("select-all", select_all_controller_default);
6089461027
application.register("smooth", smooth_controller_default);
61028+
application.register("snippet", snippet_controller_default);
6089561029
application.register("tabs", tabs_controller_default);
6089661030
application.register("pages", pages_controller_default);
6089761031
application.register("toggle", toggle_controller_default);

app/assets/builds/railsui/application.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/images/blur.png

236 KB
Loading

app/assets/images/railsui-logo.svg

Lines changed: 8 additions & 0 deletions
Loading
60.5 KB
Loading
60.1 KB
Loading

app/assets/stylesheets/railsui/application.tailwind.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
@import "code.css";
88
@import "docs.css";
99
@import "forms.css";
10-
11-
@import "scrollbars.css";
10+
@import "buttons.css";
1211

1312
@import "tailwindcss/utilities";
1413
@import "tippy.js/dist/tippy.css";
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.railsui {
2+
.rui-btn {
3+
@apply rounded-md px-3 py-[5px] text-white ring-4 ring-transparent text-base inline-block transition-colors ease-in-out duration-300 border border-transparent disabled:opacity-50 disabled:pointer-events-none disabled:cursor-not-allowed text-center text-[14.5px] font-semibold;
4+
5+
&.rui-btn-lg {
6+
@apply py-3 px-6 text-lg;
7+
}
8+
9+
&.rui-btn-sm {
10+
@apply py-0.5 px-3 text-[13.5px];
11+
}
12+
}
13+
14+
.rui-btn-white {
15+
@apply bg-white hover:bg-neutral-50/50 hover:shadow-none shadow-sm text-neutral-800/80 border border-neutral-300/80 shadow-neutral-300/20 focus:ring-4 hover:border-neutral-600/40 focus:ring-neutral-100/70 focus:border-neutral-300/90 dark:bg-neutral-700/60 dark:text-white dark:border-neutral-500/30 dark:shadow-neutral-950/40 dark:hover:bg-neutral-800/90 dark:focus:ring-neutral-700/80 dark:focus:border-neutral-500/80;
16+
}
17+
18+
.rui-btn-offwhite {
19+
@apply bg-neutral-200/20 hover:bg-neutral-50/50 hover:shadow-none shadow-sm text-neutral-800/80 border border-neutral-300/80 shadow-neutral-300/20 focus:ring-4 hover:border-neutral-600/40 focus:ring-neutral-100/70 focus:border-neutral-300/90 dark:bg-neutral-700/60 dark:text-white dark:border-neutral-500/30 dark:shadow-neutral-950/40 dark:hover:bg-neutral-800/90 dark:focus:ring-neutral-700/80 dark:focus:border-neutral-500/80;
20+
}
21+
22+
.rui-btn-transparent {
23+
@apply bg-transparent text-neutral-700 focus:ring-neutral-100/70 hover:bg-neutral-50/70 hover:text-neutral-800 dark:focus:ring-neutral-600/80 dark:hover:bg-neutral-900 focus:outline focus:outline-neutral-200/80 dark:focus:outline-neutral-700/80 dark:text-neutral-200;
24+
}
25+
26+
.rui-btn-black {
27+
@apply bg-neutral-950 text-neutral-100 focus:ring-neutral-100/70 hover:text-neutral-50 hover:ring-4 hover:ring-black/10 focus:outline focus:outline-neutral-200/80 dark:focus:outline-neutral-700/80 dark:bg-neutral-50 dark:text-neutral-950 dark:hover:bg-neutral-100/80 dark:hover:text-neutral-950 dark:focus:ring-neutral-700/30;
28+
}
29+
}

0 commit comments

Comments
 (0)