← back to joeleaver__rinch

Function bodies 1,000 total

All specs Real LLM only Function bodies
generate_all_component_styles function · rust · L64-L135 (72 LOC)
crates/rinch-components/src/styles/mod.rs
pub fn generate_all_component_styles() -> String {
    let mut css = String::with_capacity(32768);

    css.push_str(&button::styles());
    css.push_str(&text_input::styles());
    css.push_str(&text::styles());
    css.push_str(&paper::styles());
    css.push_str(&stack::styles());
    css.push_str(&group::styles());
    css.push_str(&simple_grid::styles());
    css.push_str(&badge::styles());
    css.push_str(&divider::styles());
    css.push_str(&container::styles());
    css.push_str(&center::styles());
    css.push_str(&space::styles());
    css.push_str(&title::styles());
    css.push_str(&anchor::styles());
    css.push_str(&code::styles());
    css.push_str(&kbd::styles());
    css.push_str(&textarea::styles());
    css.push_str(&checkbox::styles());
    css.push_str(&switch::styles());
    css.push_str(&select::styles());
    css.push_str(&fieldset::styles());
    css.push_str(&alert::styles());
    css.push_str(&loader::styles());
    css.push_str(&progress::styles());
    c
styles function · rust · L1-L151 (151 LOC)
crates/rinch-components/src/styles/navlink.rs
pub fn styles() -> String {
    r#"
/* NavLink wrapper */
.rinch-navlink__wrapper {
    display: flex;
    flex-direction: column;
}

/* NavLink base */
.rinch-navlink {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.625rem var(--rinch-spacing-sm);
    font-size: var(--rinch-font-size-sm);
    color: var(--rinch-color-text);
    text-decoration: none;
    background-color: transparent;
    border: none;
    border-radius: var(--rinch-radius-sm);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
    text-align: left;
}

.rinch-navlink:hover {
    background-color: var(--rinch-color-default);
}

/* Default variant */
.rinch-navlink--default.rinch-navlink--active {
    background-color: var(--rinch-navlink-color, var(--rinch-primary-color));
    color: white;
}

.rinch-navlink--default.rinch-navlink--active:hover {
    background-color: var(--rinch-navlink-color, var(--rinch-primary-color));
}

/* Light variant */
.rinch-navli
styles function · rust · L1-L149 (149 LOC)
crates/rinch-components/src/styles/notification.rs
pub fn styles() -> String {
    r#"
/* Notification base */
.rinch-notification {
    display: flex;
    align-items: flex-start;
    gap: var(--rinch-spacing-sm);
    padding: var(--rinch-spacing-md);
    background-color: var(--rinch-color-body);
    border-radius: var(--rinch-radius-default);
    box-shadow: var(--rinch-shadow-md);
    min-width: 300px;
    max-width: 400px;
    position: fixed;
    z-index: 300;
}

/* Hidden state */
.rinch-notification--hidden {
    display: none !important;
}

/* Positions */
.rinch-notification--top-left {
    top: var(--rinch-spacing-md);
    left: var(--rinch-spacing-md);
}

.rinch-notification--top-center {
    top: var(--rinch-spacing-md);
    left: 50%;
    transform: translateX(-50%);
}

.rinch-notification--top-right {
    top: var(--rinch-spacing-md);
    right: var(--rinch-spacing-md);
}

.rinch-notification--bottom-left {
    bottom: var(--rinch-spacing-md);
    left: var(--rinch-spacing-md);
}

.rinch-notification--bottom-center {
   
styles function · rust · L1-L139 (139 LOC)
crates/rinch-components/src/styles/number_input.rs
pub fn styles() -> String {
    r#"
/* NumberInput base */
.rinch-number-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rinch-number-input__label {
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
}

.rinch-number-input__description {
    font-size: var(--rinch-font-size-xs);
    color: var(--rinch-color-dimmed);
}

.rinch-number-input__wrapper {
    display: flex;
    align-items: stretch;
    position: relative;
    min-width: 10rem;
}

.rinch-number-input__input {
    flex: 1;
    font-family: var(--rinch-font-family);
    font-size: var(--rinch-font-size-sm);
    color: var(--rinch-color-text);
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    padding: 0 var(--rinch-spacing-sm);
    height: 2.625rem;
    transition: border-color 150ms ease;
}

.rinch-number-input__input:focus {
    outline: none;
    borde
styles function · rust · L1-L159 (159 LOC)
crates/rinch-components/src/styles/pagination.rs
pub fn styles() -> String {
    r#"
/* Pagination base */
.rinch-pagination {
    display: inline-flex;
    align-items: center;
}

.rinch-pagination__controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Pagination items container */
.rinch-pagination__items {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Pagination item (page number) */
.rinch-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
    background-color: transparent;
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.rinch-pagination__item:hover:not(:disabled):not(.rinch-pagination__item--active) {
    background-color: var(--rinch-color-f
styles function · rust · L1-L36 (36 LOC)
crates/rinch-components/src/styles/paper.rs
pub fn styles() -> String {
    r#"
/* Paper base */
.rinch-paper {
    background-color: var(--rinch-color-body);
    border-radius: var(--rinch-radius-default);
}

/* Paper shadows */
.rinch-paper--shadow-xs { box-shadow: var(--rinch-shadow-xs); }
.rinch-paper--shadow-sm { box-shadow: var(--rinch-shadow-sm); }
.rinch-paper--shadow-md { box-shadow: var(--rinch-shadow-md); }
.rinch-paper--shadow-lg { box-shadow: var(--rinch-shadow-lg); }
.rinch-paper--shadow-xl { box-shadow: var(--rinch-shadow-xl); }

/* Paper with border */
.rinch-paper--with-border {
    border: 1px solid var(--rinch-color-border);
}

/* Paper padding */
.rinch-paper--p-xs { padding: var(--rinch-spacing-xs); }
.rinch-paper--p-sm { padding: var(--rinch-spacing-sm); }
.rinch-paper--p-md { padding: var(--rinch-spacing-md); }
.rinch-paper--p-lg { padding: var(--rinch-spacing-lg); }
.rinch-paper--p-xl { padding: var(--rinch-spacing-xl); }

/* Paper radius */
.rinch-paper--radius-xs { border-radius: var(--rinch-radius-xs);
styles function · rust · L1-L119 (119 LOC)
crates/rinch-components/src/styles/password_input.rs
pub fn styles() -> String {
    r#"
/* PasswordInput base */
.rinch-password-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rinch-password-input__label {
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
}

.rinch-password-input__description {
    font-size: var(--rinch-font-size-xs);
    color: var(--rinch-color-dimmed);
}

.rinch-password-input__wrapper {
    display: flex;
    align-items: center;
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    height: 2.625rem;
    overflow: hidden;
    transition: border-color 150ms ease;
    min-width: 10rem;
}

.rinch-password-input__wrapper:focus-within {
    border-color: var(--rinch-primary-color);
}

.rinch-password-input__input {
    flex: 1;
    min-width: 0;
    font-family: var(--rinch-font-family);
    font-size: var(--rinch-font-size-sm);
    background-color
Repobility analyzer · published findings · https://repobility.com
styles function · rust · L1-L152 (152 LOC)
crates/rinch-components/src/styles/popover.rs
pub fn styles() -> String {
    r#"
/* Popover base */
.rinch-popover {
    position: relative;
    display: inline-block;
}

/* Target */
.rinch-popover__target {
    display: inline-block;
}

/* Dropdown */
.rinch-popover__dropdown {
    position: absolute;
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    box-shadow: var(--rinch-shadow-md);
    padding: var(--rinch-spacing-sm);
    width: var(--rinch-popover-width, auto);
    min-width: 150px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;
}

.rinch-popover--opened .rinch-popover__dropdown {
    opacity: 1;
    visibility: visible;
}

/* Positions */
.rinch-popover--bottom .rinch-popover__dropdown {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(var(--rinch-popover-offset, 8px));
}

.rinch-popover--bottom-start .rinch-po
styles function · rust · L1-L59 (59 LOC)
crates/rinch-components/src/styles/progress.rs
pub fn styles() -> String {
    r#"
/* Progress base */
.rinch-progress {
    width: 100%;
    background-color: var(--rinch-color-default);
    border-radius: var(--rinch-radius-default);
    overflow: hidden;
}

/* Progress sizes */
.rinch-progress--xs { height: 0.25rem; }
.rinch-progress--sm { height: 0.5rem; }
.rinch-progress--md { height: 0.75rem; }
.rinch-progress--lg { height: 1rem; }
.rinch-progress--xl { height: 1.5rem; }

/* Progress bar fill */
.rinch-progress__bar {
    height: 100%;
    background-color: var(--rinch-progress-color, var(--rinch-primary-color));
    border-radius: inherit;
    transition: width 200ms ease;
}

/* Striped pattern */
.rinch-progress__bar--striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1r
styles function · rust · L1-L143 (143 LOC)
crates/rinch-components/src/styles/radio.rs
pub fn styles() -> String {
    r#"
/* Radio base */
.rinch-radio {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--rinch-spacing-sm);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.rinch-radio--disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hide native radio but keep interactive */
.rinch-radio__input {
    position: absolute;
    opacity: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

/* Custom radio indicator */
.rinch-radio__indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--rinch-color-border);
    border-radius: 50%;
    background-color: var(--rinch-color-body);
    transition: all 150ms ease;
    flex-shrink: 0;
}

/* Checked state */
.rinch-radio--checked .rinch-radio__indicator {
    background-color: var(--rinch-radio-color, var(--rinch-primary-color));
    border
styles function · rust · L1-L65 (65 LOC)
crates/rinch-components/src/styles/select.rs
pub fn styles() -> String {
    r#"
/* Select wrapper */
.rinch-select {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rinch-select__label {
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
}

/* Select input */
.rinch-select__input {
    font-family: var(--rinch-font-family);
    font-size: var(--rinch-font-size-sm);
    color: var(--rinch-color-text);
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    padding: 0 2rem 0 var(--rinch-spacing-sm);
    height: 2.625rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23868e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repe
styles function · rust · L1-L9 (9 LOC)
crates/rinch-components/src/styles/simple_grid.rs
pub fn styles() -> String {
    r#"
/* SimpleGrid - prevent content from expanding grid columns */
.rinch-simple-grid > * {
    min-width: 0;
}
"#
    .to_string()
}
styles function · rust · L1-L40 (40 LOC)
crates/rinch-components/src/styles/skeleton.rs
pub fn styles() -> String {
    r#"
/* Skeleton base */
.rinch-skeleton {
    background-color: var(--rinch-color-default);
    border-radius: var(--rinch-radius-default);
    min-height: 1rem;
}

/* Skeleton animation */
.rinch-skeleton--animate {
    background: linear-gradient(
        90deg,
        var(--rinch-color-default) 0%,
        var(--rinch-color-filled) 50%,
        var(--rinch-color-default) 100%
    );
    background-size: 200% 100%;
    animation: rinch-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes rinch-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton circle */
.rinch-skeleton--circle {
    border-radius: 50%;
}

/* Skeleton radius */
.rinch-skeleton--radius-xs { border-radius: var(--rinch-radius-xs); }
.rinch-skeleton--radius-sm { border-radius: var(--rinch-radius-sm); }
.rinch-skeleton--radius-md { border-radius: var(--rinch-radius-md); }
.rinch-skeleton--radius-lg { border-radius: var(--rin
styles function · rust · L1-L125 (125 LOC)
crates/rinch-components/src/styles/slider.rs
pub fn styles() -> String {
    r#"
/* Slider base - clickable container */
.rinch-slider {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 1.5rem;
    touch-action: none;
    user-select: none;
    cursor: pointer;
}

/* Slider track - pointer-events: none so clicks pass through to container */
.rinch-slider__track {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--rinch-color-default);
    border-radius: var(--rinch-radius-xl);
    overflow: hidden;
    pointer-events: none;
}

/* Slider bar (filled portion) - pointer-events: none so clicks pass through */
.rinch-slider__bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--rinch-slider-value, 0%);
    background-color: var(--rinch-slider-color, var(--rinch-primary-color));
    border-radius: inherit;
    pointer-events: none;
}

/* Slider thumb wrapper - positioned via CSS variable */
.rinch-slider__thu
styles function · rust · L1-L23 (23 LOC)
crates/rinch-components/src/styles/space.rs
pub fn styles() -> String {
    r#"
/* Space - creates empty space */
.rinch-space {
    display: block;
}

/* Horizontal space (width) */
.rinch-space--w-xs { width: var(--rinch-spacing-xs); }
.rinch-space--w-sm { width: var(--rinch-spacing-sm); }
.rinch-space--w-md { width: var(--rinch-spacing-md); }
.rinch-space--w-lg { width: var(--rinch-spacing-lg); }
.rinch-space--w-xl { width: var(--rinch-spacing-xl); }

/* Vertical space (height) */
.rinch-space--h-xs { height: var(--rinch-spacing-xs); }
.rinch-space--h-sm { height: var(--rinch-spacing-sm); }
.rinch-space--h-md { height: var(--rinch-spacing-md); }
.rinch-space--h-lg { height: var(--rinch-spacing-lg); }
.rinch-space--h-xl { height: var(--rinch-spacing-xl); }
"#
    .to_string()
}
Want this analysis on your repo? https://repobility.com/scan/
styles function · rust · L1-L30 (30 LOC)
crates/rinch-components/src/styles/stack.rs
pub fn styles() -> String {
    r#"
/* Stack base */
.rinch-stack {
    display: flex;
    flex-direction: column;
}

/* Stack gap */
.rinch-stack--gap-xs { gap: var(--rinch-spacing-xs); }
.rinch-stack--gap-sm { gap: var(--rinch-spacing-sm); }
.rinch-stack--gap-md { gap: var(--rinch-spacing-md); }
.rinch-stack--gap-lg { gap: var(--rinch-spacing-lg); }
.rinch-stack--gap-xl { gap: var(--rinch-spacing-xl); }

/* Stack alignment */
.rinch-stack--align-stretch { align-items: stretch; }
.rinch-stack--align-start { align-items: flex-start; }
.rinch-stack--align-center { align-items: center; }
.rinch-stack--align-end { align-items: flex-end; }

/* Stack justification */
.rinch-stack--justify-start { justify-content: flex-start; }
.rinch-stack--justify-center { justify-content: center; }
.rinch-stack--justify-end { justify-content: flex-end; }
.rinch-stack--justify-between { justify-content: space-between; }
.rinch-stack--justify-around { justify-content: space-around; }
"#
    .to_string()
}
styles function · rust · L1-L93 (93 LOC)
crates/rinch-components/src/styles/switch.rs
pub fn styles() -> String {
    r#"
/* Switch wrapper */
.rinch-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--rinch-spacing-sm);
    cursor: pointer;
    user-select: none;
}

.rinch-switch--disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hide native checkbox but keep it interactive */
.rinch-switch__input {
    position: absolute;
    opacity: 0;
    width: 2.5rem;
    height: 1.5rem;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

/* Switch track */
.rinch-switch__track {
    position: relative;
    width: 2.5rem;
    height: 1.5rem;
    background-color: var(--rinch-color-default);
    border-radius: 1rem;
    transition: background-color 150ms ease;
    flex-shrink: 0;
}

/* Checked state via class */
.rinch-switch--checked .rinch-switch__track {
    background-color: var(--rinch-primary-color);
}

.rinch-switch__input:focus + .rinch-switch__track {
    box-shadow: 0 0 0 2px var(--rinch-primary-color-2);
}

/* Switch thumb */
.rinch-s
styles function · rust · L1-L174 (174 LOC)
crates/rinch-components/src/styles/tabs.rs
pub fn styles() -> String {
    r#"
/* Tabs base */
.rinch-tabs {
    display: flex;
    flex-direction: column;
}

.rinch-tabs--vertical {
    flex-direction: row;
}

.rinch-tabs--position-bottom {
    flex-direction: column-reverse;
}

.rinch-tabs--position-right {
    flex-direction: row-reverse;
}

/* Tabs list */
.rinch-tabs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--rinch-color-border);
}

.rinch-tabs--vertical .rinch-tabs__list {
    flex-direction: column;
    border-bottom: none;
    border-right: 2px solid var(--rinch-color-border);
}

.rinch-tabs--position-bottom .rinch-tabs__list {
    border-bottom: none;
    border-top: 2px solid var(--rinch-color-border);
}

.rinch-tabs--position-right .rinch-tabs__list {
    border-right: none;
    border-left: 2px solid var(--rinch-color-border);
}

.rinch-tabs__list--grow {
    justify-content: stretch;
}

.rinch-tabs__list--grow .rinch-tabs__tab {
    flex: 1;
}

/* Tab button */
.r
styles function · rust · L1-L70 (70 LOC)
crates/rinch-components/src/styles/textarea.rs
pub fn styles() -> String {
    r#"
/* Textarea base */
.rinch-textarea {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rinch-textarea__label {
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
}

.rinch-textarea__input {
    font-family: var(--rinch-font-family);
    font-size: var(--rinch-font-size-sm);
    color: var(--rinch-color-text);
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    padding: var(--rinch-spacing-sm);
    resize: vertical;
    min-height: 80px;
    transition: border-color 150ms ease;
}

.rinch-textarea__input:focus {
    outline: none;
    border-color: var(--rinch-primary-color);
}

.rinch-textarea__input::placeholder {
    color: var(--rinch-color-placeholder);
}

.rinch-textarea__input:disabled {
    background-color: var(--rinch-color-filled);
    cursor: not-allowed;
    resize: none;
}

.r
styles function · rust · L1-L83 (83 LOC)
crates/rinch-components/src/styles/text_input.rs
pub fn styles() -> String {
    r#"
/* TextInput base */
.rinch-text-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rinch-text-input__label {
    font-size: var(--rinch-font-size-sm);
    font-weight: 500;
    color: var(--rinch-color-text);
}

.rinch-text-input__input {
    font-family: var(--rinch-font-family);
    font-size: var(--rinch-font-size-sm);
    color: var(--rinch-color-text);
    background-color: var(--rinch-color-body);
    border: 1px solid var(--rinch-color-border);
    border-radius: var(--rinch-radius-default);
    transition: border-color 150ms ease;
    min-width: 10rem;
}

.rinch-text-input__input:focus {
    outline: none;
    border-color: var(--rinch-primary-color);
}

.rinch-text-input__input::placeholder {
    color: var(--rinch-color-placeholder);
}

.rinch-text-input__input:disabled {
    background-color: var(--rinch-color-filled);
    cursor: not-allowed;
}

/* TextInput sizes */
.rinch-text-input--xs .rinch-text-input__inpu
styles function · rust · L1-L74 (74 LOC)
crates/rinch-components/src/styles/text.rs
pub fn styles() -> String {
    r#"
/* Text base */
.rinch-text {
    font-family: var(--rinch-font-family);
    margin: 0;
}

/* Text sizes */
.rinch-text--xs { font-size: var(--rinch-font-size-xs); line-height: var(--rinch-line-height-xs); }
.rinch-text--sm { font-size: var(--rinch-font-size-sm); line-height: var(--rinch-line-height-sm); }
.rinch-text--md { font-size: var(--rinch-font-size-md); line-height: var(--rinch-line-height-md); }
.rinch-text--lg { font-size: var(--rinch-font-size-lg); line-height: var(--rinch-line-height-lg); }
.rinch-text--xl { font-size: var(--rinch-font-size-xl); line-height: var(--rinch-line-height-xl); }

/* Text weights */
.rinch-text--thin { font-weight: 100; }
.rinch-text--extralight { font-weight: 200; }
.rinch-text--light { font-weight: 300; }
.rinch-text--normal { font-weight: 400; }
.rinch-text--medium { font-weight: 500; }
.rinch-text--semibold { font-weight: 600; }
.rinch-text--bold { font-weight: 700; }
.rinch-text--extrabold { font-weight: 800
styles function · rust · L1-L53 (53 LOC)
crates/rinch-components/src/styles/title.rs
pub fn styles() -> String {
    r#"
/* Title base */
.rinch-title {
    font-family: var(--rinch-font-family);
    margin: 0;
    color: var(--rinch-color-text);
}

/* Title levels (h1-h6) */
.rinch-title--1 {
    font-size: var(--rinch-h1-font-size);
    font-weight: var(--rinch-h1-font-weight);
    line-height: var(--rinch-h1-line-height);
}

.rinch-title--2 {
    font-size: var(--rinch-h2-font-size);
    font-weight: var(--rinch-h2-font-weight);
    line-height: var(--rinch-h2-line-height);
}

.rinch-title--3 {
    font-size: var(--rinch-h3-font-size);
    font-weight: var(--rinch-h3-font-weight);
    line-height: var(--rinch-h3-line-height);
}

.rinch-title--4 {
    font-size: var(--rinch-h4-font-size);
    font-weight: var(--rinch-h4-font-weight);
    line-height: var(--rinch-h4-line-height);
}

.rinch-title--5 {
    font-size: var(--rinch-h5-font-size);
    font-weight: var(--rinch-h5-font-weight);
    line-height: var(--rinch-h5-line-height);
}

.rinch-title--6 {
    font-size: 
styles function · rust · L1-L132 (132 LOC)
crates/rinch-components/src/styles/tooltip.rs
pub fn styles() -> String {
    r#"
/* Tooltip base */
.rinch-tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip target */
.rinch-tooltip__target {
    display: inline-block;
}

/* Tooltip content */
.rinch-tooltip__content {
    position: absolute;
    z-index: 1000;
    padding: 0.375rem 0.625rem;
    background-color: var(--rinch-tooltip-color, var(--rinch-color-gray-9));
    color: white;
    font-size: var(--rinch-font-size-xs);
    border-radius: var(--rinch-radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
}

/* Tooltip positions */
.rinch-tooltip--top .rinch-tooltip__content {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.25rem);
    margin-bottom: 0.375rem;
}

.rinch-tooltip--bottom .rinch-tooltip__content {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0.25rem);
    margin-top: 0.375rem;
}

.rinch-tooltip--l
Powered by Repobility — scan your code at https://repobility.com
styles function · rust · L2-L131 (130 LOC)
crates/rinch-components/src/styles/tree.rs
pub fn styles() -> String {
    r#"
/* Tree container */
.rinch-tree {
    --tree-level-offset: var(--rinch-spacing-md);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--rinch-font-size-sm);
}

/* Tree node */
.rinch-tree__node {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Node content wrapper */
.rinch-tree__node-content {
    display: flex;
    align-items: center;
    padding: var(--rinch-spacing-xs) var(--rinch-spacing-sm);
    padding-left: 0;
    cursor: pointer;
    border-radius: var(--rinch-radius-sm);
    transition: background-color 150ms ease;
    user-select: none;
}

.rinch-tree__node-content:hover {
    background-color: var(--rinch-color-gray-1);
}

.rinch-tree__node-content--selected {
    background-color: var(--rinch-color-primary-1);
    color: var(--rinch-primary-color);
}

.rinch-tree__node-content--selected:hover {
    background-color: var(--rinch-color-primary-2);
}

.rinch-tree__node-content--disabled {
    opacity: 0.5
fmt function · rust · L51-L65 (15 LOC)
crates/rinch-components/src/switch.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("Switch")
            .field("label", &self.label)
            .field("description", &self.description)
            .field("size", &self.size)
            .field("disabled", &self.disabled)
            .field("checked", &self.checked)
            .field(
                "checked_fn",
                &self.checked_fn.as_ref().map(|_| "<reactive>"),
            )
            .field("label_position", &self.label_position)
            .field("onchange", &self.onchange.as_ref().map(|_| "<callback>"))
            .finish()
    }
base_class_string function · rust · L70-L95 (26 LOC)
crates/rinch-components/src/switch.rs
    fn base_class_string(&self) -> String {
        let mut classes = vec!["rinch-switch"];

        // Size
        if !self.size.is_empty() {
            match self.size.as_str() {
                "xs" => classes.push("rinch-switch--xs"),
                "sm" => classes.push("rinch-switch--sm"),
                "md" => classes.push("rinch-switch--md"),
                "lg" => classes.push("rinch-switch--lg"),
                _ => {}
            }
        }

        // Disabled
        if self.disabled {
            classes.push("rinch-switch--disabled");
        }

        // Label position
        if !self.label_position.is_empty() && self.label_position == "start" {
            classes.push("rinch-switch--label-start");
        }

        classes.join(" ")
    }
class_string function · rust · L98-L104 (7 LOC)
crates/rinch-components/src/switch.rs
    pub fn class_string(&self) -> String {
        let mut class = self.base_class_string();
        if self.checked {
            class.push_str(" rinch-switch--checked");
        }
        class
    }
render function · rust · L108-L190 (83 LOC)
crates/rinch-components/src/switch.rs
    fn render(&self, scope: &mut RenderScope, _children: &[NodeHandle]) -> NodeHandle {
        let base_class = self.base_class_string();

        // Determine if we have a reactive checked state
        let is_checked = if let Some(ref checked_fn) = self.checked_fn {
            checked_fn()
        } else {
            self.checked
        };

        // Build the class string
        let class = if is_checked {
            format!("{} rinch-switch--checked", base_class)
        } else {
            base_class
        };

        // Create label container
        let label_node = scope.create_element("label");
        label_node.set_attribute("class", &class);

        // Register handler
        if let Some(cb) = &self.onchange {
            let handler_id = scope.register_handler({
                let cb = cb.clone();
                move || cb.invoke()
            });
            label_node.set_attribute("data-rid", &handler_id.to_string());
        }

        // Input element (h
class_name function · rust · L19-L25 (7 LOC)
crates/rinch-components/src/tabs.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            TabsVariant::Default => "rinch-tabs--default",
            TabsVariant::Outline => "rinch-tabs--outline",
            TabsVariant::Pills => "rinch-tabs--pills",
        }
    }
from_str function · rust · L30-L37 (8 LOC)
crates/rinch-components/src/tabs.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "default" => Ok(TabsVariant::Default),
            "outline" => Ok(TabsVariant::Outline),
            "pills" => Ok(TabsVariant::Pills),
            _ => Err(()),
        }
    }
class_name function · rust · L49-L54 (6 LOC)
crates/rinch-components/src/tabs.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            TabsOrientation::Horizontal => "rinch-tabs--horizontal",
            TabsOrientation::Vertical => "rinch-tabs--vertical",
        }
    }
About: code-quality intelligence by Repobility · https://repobility.com
from_str function · rust · L59-L65 (7 LOC)
crates/rinch-components/src/tabs.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "horizontal" => Ok(TabsOrientation::Horizontal),
            "vertical" => Ok(TabsOrientation::Vertical),
            _ => Err(()),
        }
    }
class_name function · rust · L79-L86 (8 LOC)
crates/rinch-components/src/tabs.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            TabsPosition::Top => "rinch-tabs--position-top",
            TabsPosition::Bottom => "rinch-tabs--position-bottom",
            TabsPosition::Left => "rinch-tabs--position-left",
            TabsPosition::Right => "rinch-tabs--position-right",
        }
    }
from_str function · rust · L91-L99 (9 LOC)
crates/rinch-components/src/tabs.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "top" => Ok(TabsPosition::Top),
            "bottom" => Ok(TabsPosition::Bottom),
            "left" => Ok(TabsPosition::Left),
            "right" => Ok(TabsPosition::Right),
            _ => Err(()),
        }
    }
class_string function · rust · L139-L169 (31 LOC)
crates/rinch-components/src/tabs.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-tabs"];

        if !self.variant.is_empty() {
            if let Ok(variant) = self.variant.parse::<TabsVariant>() {
                classes.push(variant.class_name());
            }
        } else {
            classes.push(TabsVariant::Default.class_name());
        }

        if !self.orientation.is_empty() {
            if let Ok(orientation) = self.orientation.parse::<TabsOrientation>() {
                classes.push(orientation.class_name());
            }
        } else {
            classes.push(TabsOrientation::Horizontal.class_name());
        }

        if !self.position.is_empty()
            && let Ok(position) = self.position.parse::<TabsPosition>()
        {
            classes.push(position.class_name());
        }

        if self.grow {
            classes.push("rinch-tabs--grow");
        }

        classes.join(" ")
    }
render function · rust · L173-L201 (29 LOC)
crates/rinch-components/src/tabs.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let container = rinch_macros::rsx! { div { class: "rinch-tabs" } };
        container.set_attribute("class", &self.class_string());

        let active_value = if !self.value.is_empty() {
            &self.value
        } else {
            &self.default_value
        };
        if !active_value.is_empty() {
            container.set_attribute("data-active-tab", active_value);
        }

        if !self.color.is_empty() {
            let c = &self.color;
            let style = if c.starts_with('#') || c.starts_with("rgb") || c.starts_with("hsl") {
                format!("--rinch-tabs-color: {}", c)
            } else {
                format!("--rinch-tabs-color: var(--rinch-color-{}-6)", c)
            };
            container.set_attribute("style", &style);
        }

        for child in children {
            container.append_child(child);
        }

        container
    }
render function · rust · L214-L233 (20 LOC)
crates/rinch-components/src/tabs.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let mut classes = vec!["rinch-tabs__list"];

        if self.grow {
            classes.push("rinch-tabs__list--grow");
        }

        let list = rinch_macros::rsx! { div { class: "rinch-tabs__list", role: "tablist" } };
        list.set_attribute("class", &classes.join(" "));

        if !self.justify.is_empty() {
            list.set_attribute("style", &format!("justify-content: {}", self.justify));
        }

        for child in children {
            list.append_child(child);
        }

        list
    }
fmt function · rust · L252-L259 (8 LOC)
crates/rinch-components/src/tabs.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("Tab")
            .field("value", &self.value)
            .field("disabled", &self.disabled)
            .field("left_section", &self.left_section)
            .field("right_section", &self.right_section)
            .finish_non_exhaustive()
    }
render function · rust · L263-L316 (54 LOC)
crates/rinch-components/src/tabs.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let mut classes = vec!["rinch-tabs__tab"];

        if self.disabled {
            classes.push("rinch-tabs__tab--disabled");
        }

        let btn = rinch_macros::rsx! { button { class: "rinch-tabs__tab", role: "tab" } };
        btn.set_attribute("class", &classes.join(" "));

        if !self.value.is_empty() {
            btn.set_attribute("data-tab-value", &self.value);
        }

        if self.disabled {
            btn.set_attribute("disabled", "");
        }

        // Register click handler
        if let Some(ref cb) = self.onclick
            && !self.disabled
        {
            let handler_id = __scope.register_handler({
                let cb = cb.clone();
                move || cb.invoke()
            });
            btn.set_attribute("data-rid", &handler_id.0.to_string());
        }

        // Left section icon
        if let Some(left) = self.left_section {
    
Repobility analyzer · published findings · https://repobility.com
render function · rust · L327-L339 (13 LOC)
crates/rinch-components/src/tabs.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let panel = rinch_macros::rsx! { div { class: "rinch-tabs__panel", role: "tabpanel" } };

        if !self.value.is_empty() {
            panel.set_attribute("data-panel-value", &self.value);
        }

        for child in children {
            panel.append_child(child);
        }

        panel
    }
fmt function · rust · L43-L59 (17 LOC)
crates/rinch-components/src/textarea.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("Textarea")
            .field("label", &self.label)
            .field("description", &self.description)
            .field("error", &self.error)
            .field("placeholder", &self.placeholder)
            .field("size", &self.size)
            .field("disabled", &self.disabled)
            .field("required", &self.required)
            .field("autosize", &self.autosize)
            .field("min_rows", &self.min_rows)
            .field("max_rows", &self.max_rows)
            .field("value", &self.value)
            .field("value_fn", &self.value_fn.as_ref().map(|_| "<reactive>"))
            .field("oninput", &self.oninput.as_ref().map(|_| "<callback>"))
            .finish()
    }
class_string function · rust · L64-L90 (27 LOC)
crates/rinch-components/src/textarea.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-textarea"];

        // Size
        if !self.size.is_empty() {
            match self.size.as_str() {
                "xs" => classes.push("rinch-textarea--xs"),
                "sm" => classes.push("rinch-textarea--sm"),
                "md" => classes.push("rinch-textarea--md"),
                "lg" => classes.push("rinch-textarea--lg"),
                "xl" => classes.push("rinch-textarea--xl"),
                _ => {}
            }
        }

        // Error state
        if !self.error.is_empty() {
            classes.push("rinch-textarea--error");
        }

        // Autosize
        if self.autosize {
            classes.push("rinch-textarea--autosize");
        }

        classes.join(" ")
    }
render function · rust · L94-L178 (85 LOC)
crates/rinch-components/src/textarea.rs
    fn render(&self, __scope: &mut RenderScope, _children: &[NodeHandle]) -> NodeHandle {
        let container = rinch_macros::rsx! { div { class: "rinch-textarea" } };
        container.set_attribute("class", &self.class_string());

        // Label
        if !self.label.is_empty() {
            let label_text = &self.label;
            let label = rinch_macros::rsx! { label { class: "rinch-textarea__label" } };
            let label_text_node = __scope.create_text(label_text);
            label.append_child(&label_text_node);

            if self.required {
                let required_span =
                    rinch_macros::rsx! { span { class: "rinch-textarea__required", "*" } };
                label.append_child(&required_span);
            }

            container.append_child(&label);
        }

        // Textarea element
        let textarea = rinch_macros::rsx! { textarea { class: "rinch-textarea__input" } };

        if !self.placeholder.is_empty() {
            textarea
class_name function · rust · L25-L33 (9 LOC)
crates/rinch-components/src/text_input.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            TextInputSize::Xs => "rinch-text-input--xs",
            TextInputSize::Sm => "rinch-text-input--sm",
            TextInputSize::Md => "rinch-text-input--md",
            TextInputSize::Lg => "rinch-text-input--lg",
            TextInputSize::Xl => "rinch-text-input--xl",
        }
    }
from_str function · rust · L38-L48 (11 LOC)
crates/rinch-components/src/text_input.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "xs" => Ok(TextInputSize::Xs),
            "sm" => Ok(TextInputSize::Sm),
            "md" => Ok(TextInputSize::Md),
            "lg" => Ok(TextInputSize::Lg),
            "xl" => Ok(TextInputSize::Xl),
            _ => Err(()),
        }
    }
fmt function · rust · L84-L100 (17 LOC)
crates/rinch-components/src/text_input.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("TextInput")
            .field("label", &self.label)
            .field("placeholder", &self.placeholder)
            .field("description", &self.description)
            .field("error", &self.error)
            .field("size", &self.size)
            .field("disabled", &self.disabled)
            .field("required", &self.required)
            .field("radius", &self.radius)
            .field("input_type", &self.input_type)
            .field("value", &self.value)
            .field("value_fn", &self.value_fn.as_ref().map(|_| "<reactive>"))
            .field("oninput", &self.oninput.as_ref().map(|_| "<callback>"))
            .field("onsubmit", &self.onsubmit.as_ref().map(|_| "<callback>"))
            .finish()
    }
class_string function · rust · L105-L122 (18 LOC)
crates/rinch-components/src/text_input.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-text-input"];

        // Size class
        let size: TextInputSize = if self.size.is_empty() {
            TextInputSize::default()
        } else {
            self.size.parse().unwrap_or_default()
        };
        classes.push(size.class_name());

        // Error state
        if !self.error.is_empty() {
            classes.push("rinch-text-input--error");
        }

        classes.join(" ")
    }
Want this analysis on your repo? https://repobility.com/scan/
render function · rust · L126-L225 (100 LOC)
crates/rinch-components/src/text_input.rs
    fn render(&self, __scope: &mut RenderScope, _children: &[NodeHandle]) -> NodeHandle {
        let container = rinch_macros::rsx! { div { class: "rinch-text-input" } };
        container.set_attribute("class", &self.class_string());

        // Label element
        if !self.label.is_empty() {
            let label_text = &self.label;
            let label = rinch_macros::rsx! { label { class: "rinch-text-input__label" } };
            let label_text_node = __scope.create_text(label_text);
            label.append_child(&label_text_node);

            if self.required {
                let required_span =
                    rinch_macros::rsx! { span { class: "rinch-text-input__required", "*" } };
                label.append_child(&required_span);
            }

            container.append_child(&label);
        }

        // Input element
        let input_type = if self.input_type.is_empty() {
            "text"
        } else {
            &self.input_type
        };
        le
class_name function · rust · L21-L29 (9 LOC)
crates/rinch-components/src/text.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            TextSize::Xs => "rinch-text--xs",
            TextSize::Sm => "rinch-text--sm",
            TextSize::Md => "rinch-text--md",
            TextSize::Lg => "rinch-text--lg",
            TextSize::Xl => "rinch-text--xl",
        }
    }
from_str function · rust · L34-L44 (11 LOC)
crates/rinch-components/src/text.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "xs" => Ok(TextSize::Xs),
            "sm" => Ok(TextSize::Sm),
            "md" => Ok(TextSize::Md),
            "lg" => Ok(TextSize::Lg),
            "xl" => Ok(TextSize::Xl),
            _ => Err(()),
        }
    }
‹ prevpage 7 / 20next ›