### Install daisy_rsx with Cargo Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md Adds the `daisy_rsx` crate to your project's `Cargo.toml` file using the `cargo add` command. This is the standard way to manage Rust dependencies. ```bash cargo add daisy_rsx ``` -------------------------------- ### Tailwind CSS Configuration for Daisy UI Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md Example `tailwind.css` file demonstrating how to import Tailwind CSS, the DaisyUI plugin, and source Rust/TypeScript files for component styling. The `@source inline` directive is crucial for including Daisy UI classes used by Daisy RSX components. ```css @import 'tailwindcss'; @plugin "daisyui"; @source '../web-pages/**/*.rs'; @source 'typescript/**/*.ts'; @source inline("modal modal-box modal-action"); ``` -------------------------------- ### Rust MyAssistantCard Component Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md This Rust component, MyAssistantCard, renders a card for an AI assistant. It displays the assistant's name, description, icon (or avatar), visibility status, last updated time, and counts for integrations and datasets. It utilizes the daisy_rsx library for UI elements and Dioxus for component structure. ```rust #![allow(non_snake_case)] use crate::routes::prompts::Image; use daisy_rsx::* use db::queries::prompts::MyPrompt; use dioxus::prelude::* #[component] pub fn MyAssistantCard(team_id: i32, prompt: MyPrompt) -> Element { let description: String = prompt .description .chars() .filter(|&c| c != '\n' && c != '\t' && c != '\r') .collect(); rsx! { Card { class: "p-3 mt-5 flex flex-row justify-between", div { class: "flex flex-row", // Left section: Image/Avatar div { class: "flex flex-col content-center", if let Some(object_id) = prompt.image_icon_object_id { img { class: "border border-neutral-content rounded p-2", src: Image { team_id, id: object_id }.to_string(), width: "48", height: "48" } } else { Avatar { avatar_size: AvatarSize::Medium, avatar_type: AvatarType::User } } div { class: "mt-2", crate::assistants::visibility::VisLabel { visibility: prompt.visibility } } } // Middle section: Info div { class: "ml-4 text-sm flex flex-col justify-center flex-1 min-w-0", h2 { class: "font-semibold text-base mb-1", "{prompt.name}" } if !description.is_empty() { p { class: "text-sm text-base-content/70 truncate mb-2", "{description}" } } div { class: "flex items-center gap-2 text-xs text-gray-500", span { "Last updated " } RelativeTime { format: RelativeTimeFormat::Relative, datetime: "{prompt.updated_at}" } } } } // Right section: Action buttons div { class: "flex flex-row gap-5", div { class: "flex flex-col justify-center text-center", div { class: "", "{prompt.integration_count}" } div { class: "text-base-content/70", "Integration" if prompt.integration_count != 1 { "s" } } } div { class: "flex flex-col justify-center text-center", div { class: "", "{prompt.dataset_count}" } div { class: "text-base-content/70", "Dataset" if prompt.dataset_count != 1 { "s" } } } div { class: "flex flex-col justify-center ml-4 gap-2", DropDown { direction: Direction::Bottom, button_text: "...", DropDownLink { href: crate::routes::prompts::Edit{team_id, prompt_id: prompt.id}.to_string(), "Edit" } DropDownLink { href: crate::routes::prompts::ManageIntegrations{team_id, prompt_id: prompt.id}.to_string(), "Manage Integrations" } DropDownLink { href: crate::routes::prompts::ManageDatasets{team_id, prompt_id: prompt.id}.to_string(), "Manage Datasets" } DropDownLink { popover_target: format!("delete-trigger-{}-{}", prompt.id, team_id), "Delete" } } } } } } } ``` -------------------------------- ### UI Component Structure (Rust/JSX) Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md Illustrates the structure of a UI component, likely using a framework that allows JSX-like syntax within Rust. It defines navigation elements and their properties, including links and text content. ```rust { "children": [ { "tag": "div", "props": { "class": "flex flex-col" }, "children": [ { "tag": "nav", "props": { "class": "flex items-center justify-between p-4" }, "children": [ { "tag": "div", "props": { "class": "flex items-center" }, "children": [ { "tag": "a", "props": { "href": "#", "target": "_top" }, "children": [ "Home" ] } ] }, { "tag": "div", "props": { "class": "flex items-center" }, "children": [ { "tag": "a", "props": { "href": "#", "target": "_top" }, "children": [ "Settings" ] }, { "tag": "a", "props": { "href": "#", "target": "_top" }, "children": [ "Delete" ] } ] } ] } ] } ] } ``` -------------------------------- ### Create Release Command Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md Command to create a new release for a Rust project using Cargo. It bumps the version, creates a git tag, pushes changes, and triggers a publishing workflow. ```shell cargo release patch # To execute the release after previewing: cargo release patch --execute ``` -------------------------------- ### daisy_rsx Cargo.toml Dependency Source: https://github.com/bionic-gpt/daisy-rsx/blob/main/README.md Specifies the `daisy_rsx` crate and its version (`0.1`) as a dependency in your `Cargo.toml` file. This ensures the crate is available for your Rust project. ```toml [dependencies] daisy_rsx = "0.1" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.