daisyui 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +231 -0
- data/lib/daisy_ui/updated_at.rb +1 -1
- data/lib/daisy_ui/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5ead48d09f8c0ebcf05fedf37984540e379230cc2fad544c021867d76f0c111
|
|
4
|
+
data.tar.gz: 1ae9c6477704ded3ce4d51276f8c842873f3890e19674536dc5fa46e6cb9183b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47b1925d05bbf36c2b02290e80db281689ae94080a4c93392ba9ed764a1d84beb7804cd2dd2536e06da3ed71aebfe255bed64bf6feef2a6aa78bbbddc239f342
|
|
7
|
+
data.tar.gz: ffaf573ed0338c6c92ea6f57c44490081a218920e457ac7658f785d0c933958de950acfbbcb16ad87e179725da4c16fa60deec56660d6fd92424849a3c60f2f9
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 David Alejandro
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
<picture>
|
|
2
|
+
<source srcset="https://github.com/user-attachments/assets/2c4d7fdb-abe7-4f71-a6d0-ef4d41b5625a" media="(prefers-color-scheme: dark)">
|
|
3
|
+
<img src="https://github.com/user-attachments/assets/9afa9755-4aab-412a-9dc9-5eb2f76c12d6" width="350" alt="DaisyUI logo"><br>
|
|
4
|
+
</picture>
|
|
5
|
+
|
|
6
|
+
A Ruby UI component library for DaisyUI using Phlex
|
|
7
|
+
|
|
8
|
+
# Installation
|
|
9
|
+
|
|
10
|
+
## 1. Install CSS dependencies
|
|
11
|
+
|
|
12
|
+
You can install TailwindCSS and DaisyUI either via a JS bundler or via importmaps.
|
|
13
|
+
|
|
14
|
+
### JS Bundler
|
|
15
|
+
|
|
16
|
+
**TailwindCSS**
|
|
17
|
+
|
|
18
|
+
Install TailwindCSS by following the instructions in the TailwindCSS documentation, using either the Tailwind CLI or PostCSS.
|
|
19
|
+
|
|
20
|
+
**DaisyUI**
|
|
21
|
+
|
|
22
|
+
Install DaisyUI by following the instructions in the DaisyUI documentation as a Node package.
|
|
23
|
+
|
|
24
|
+
### Importmaps
|
|
25
|
+
|
|
26
|
+
**TailwindCSS with DaisyUI**
|
|
27
|
+
|
|
28
|
+
You'll need to download a TailwindCSS standalone CLI that comes bundled with DaisyUI by following the instructions in the [tailwind-cli-extra repo](https://github.com/dobicinaitis/tailwind-cli-extra).
|
|
29
|
+
|
|
30
|
+
Afterwards, place it somewhere in your project, e.g. in the bin directory.
|
|
31
|
+
|
|
32
|
+
If you want to compile the standalone TailwindCSS CLI with DaisyUI yourself, you can follow the instructions here.
|
|
33
|
+
|
|
34
|
+
**tailwindcss-rails gem**
|
|
35
|
+
|
|
36
|
+
Install tailwindcss-rails gem for Rails to automatically include your TailwindCSS stylesheets when the asset pipeline compiles your assets.
|
|
37
|
+
|
|
38
|
+
For this, you'll need to install the gem by following the instructions in the [tailwindcss-rails repo](https://github.com/rails/tailwindcss-rails).
|
|
39
|
+
|
|
40
|
+
Finally, you'll need to set the `TAILWINDCSS_INSTALL_DIR` environment variable in your Rails app pointing to the directory where you placed the binary from the tailwind-cli-extra repo mentioned above. e.g. `TAILWINDCSS_INSTALL_DIR=bin`
|
|
41
|
+
|
|
42
|
+
## 2. Install Ruby dependencies
|
|
43
|
+
|
|
44
|
+
### Install Phlex
|
|
45
|
+
|
|
46
|
+
Install Phlex by following the instructions in the [Phlex documentation](https://www.phlex.fun/#rails-introduction).
|
|
47
|
+
|
|
48
|
+
### Install DaisyUI gem
|
|
49
|
+
|
|
50
|
+
1. Add the DaisyUI gem to your Gemfile:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
bundle add daisyui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. (Optional) Include the `DaisyUI` module in `ApplicationComponent`:
|
|
57
|
+
|
|
58
|
+
```rb
|
|
59
|
+
class ApplicationComponent < Phlex::HTML
|
|
60
|
+
include DaisyUI
|
|
61
|
+
end
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This will allow you to use DaisyUI components using the short-form syntax. For example:
|
|
65
|
+
|
|
66
|
+
```rb
|
|
67
|
+
class SomeView < ApplicationView
|
|
68
|
+
def view_template
|
|
69
|
+
Button :primary do
|
|
70
|
+
"Hello, world!"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If you don't include DaisyUI, you can still use the namespaced syntax:
|
|
77
|
+
|
|
78
|
+
```rb
|
|
79
|
+
class SomeView < ApplicationView
|
|
80
|
+
def view_template
|
|
81
|
+
render DaisyUI::Button.new(:primary) do
|
|
82
|
+
"Hello, world!"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Consider not including DaisyUI in ApplicationComponent if:
|
|
89
|
+
|
|
90
|
+
- You have your own component library with the same component names as DaisyUI.
|
|
91
|
+
- You're including your own components module in `ApplicationComponent`.
|
|
92
|
+
|
|
93
|
+
In this scenario, including both DaisyUI and your own component library in `ApplicationComponent` will lead to naming conflicts.
|
|
94
|
+
|
|
95
|
+
3. Update your `tailwind.config.js` file to include DaisyUI component styles:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
const execSync = require("child_process").execSync;
|
|
99
|
+
const outputDaisyUI = execSync("bundle show daisyui", { encoding: "utf-8" });
|
|
100
|
+
const daisyUIPath = outputDaisyUI.trim() + "/**/*.rb";
|
|
101
|
+
module.exports = {
|
|
102
|
+
content: [
|
|
103
|
+
// ... other paths
|
|
104
|
+
daisyUIPath,
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
4. Update your tailwind.config.js file to detect TailwindCSS classes in Ruby files.
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
module.exports = {
|
|
113
|
+
content: [
|
|
114
|
+
// ... other paths
|
|
115
|
+
//
|
|
116
|
+
// Note the "rb" extension at the end
|
|
117
|
+
"./app/views/**/*.{erb,haml,html,slim,rb}",
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
# Compatibility Notes
|
|
123
|
+
|
|
124
|
+
## @tailwindcss/forms plugin
|
|
125
|
+
|
|
126
|
+
If you're using the `@tailwindcss/forms` plugin alongside DaisyUI, you may encounter styling conflicts with form components like Toggle, Checkbox, and Radio. The forms plugin adds default checkbox/radio styling that can interfere with DaisyUI's custom styling.
|
|
127
|
+
|
|
128
|
+
**Solution:** Add the following CSS to your stylesheet to override the forms plugin styling for DaisyUI components:
|
|
129
|
+
|
|
130
|
+
```css
|
|
131
|
+
/* Override @tailwindcss/forms checkbox styles for DaisyUI components */
|
|
132
|
+
.toggle,
|
|
133
|
+
.checkbox,
|
|
134
|
+
.radio {
|
|
135
|
+
background-image: none !important;
|
|
136
|
+
}
|
|
137
|
+
.toggle:checked,
|
|
138
|
+
.checkbox:checked,
|
|
139
|
+
.radio:checked {
|
|
140
|
+
background-image: none !important;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Alternatively, you can configure `@tailwindcss/forms` to use the `class` strategy instead of `base`, which only applies styles when you explicitly add form classes:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
// tailwind.config.js
|
|
148
|
+
plugins: [
|
|
149
|
+
require('@tailwindcss/forms')({
|
|
150
|
+
strategy: 'class', // only apply form styles to elements with form-* classes
|
|
151
|
+
}),
|
|
152
|
+
],
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
# MCP Server (Claude Code Integration)
|
|
156
|
+
|
|
157
|
+
This gem includes an MCP (Model Context Protocol) server that provides component information to AI assistants like Claude Code.
|
|
158
|
+
|
|
159
|
+
## Setup
|
|
160
|
+
|
|
161
|
+
Add to your Claude Code MCP settings (`~/.claude.json` or project `.claude.json`):
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"daisyui": {
|
|
167
|
+
"command": "bundle",
|
|
168
|
+
"args": ["exec", "daisyui-mcp"]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Available Tools
|
|
175
|
+
|
|
176
|
+
- **list_components** - List all available DaisyUI components
|
|
177
|
+
- **get_component** - Get detailed info about a specific component (modifiers, usage examples)
|
|
178
|
+
- **search_components** - Search components by name or modifier
|
|
179
|
+
|
|
180
|
+
# Usage
|
|
181
|
+
|
|
182
|
+
Refer to [the docs](https://daisyui.phlex.fun) to see how to use components. Here's an example:
|
|
183
|
+
|
|
184
|
+
```rb
|
|
185
|
+
Card :base_100 do |card|
|
|
186
|
+
figure do
|
|
187
|
+
img(src:)
|
|
188
|
+
end
|
|
189
|
+
card.body do
|
|
190
|
+
card.title do
|
|
191
|
+
"Shoes!"
|
|
192
|
+
end
|
|
193
|
+
p do
|
|
194
|
+
"If a dog chews shoes whose shoes does he choose?"
|
|
195
|
+
end
|
|
196
|
+
card.actions class: "justify-end" do
|
|
197
|
+
Button :primary do
|
|
198
|
+
"Buy Now"
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Which produces:
|
|
206
|
+
|
|
207
|
+
<img width="544" alt="Card example" src="https://github.com/user-attachments/assets/fad06a89-85fa-43cd-8c8f-7ed23b4ad77b">
|
|
208
|
+
|
|
209
|
+
# Development
|
|
210
|
+
|
|
211
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
212
|
+
|
|
213
|
+
# Contributing
|
|
214
|
+
|
|
215
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mhenrixon/daisyui. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/mhenrixon/daisyui/blob/main/CODE_OF_CONDUCT.md).
|
|
216
|
+
|
|
217
|
+
1. Visit [the docs](https://daisyui.phlex.fun/) to see which components are still not implemented or not yet added to the docs.
|
|
218
|
+
|
|
219
|
+
2. Implement it.
|
|
220
|
+
|
|
221
|
+
3. After your PR is merged, [add it to the docs](https://github.com/mhenrixon/daisyui-docs).
|
|
222
|
+
|
|
223
|
+
4. Celebrate!
|
|
224
|
+
|
|
225
|
+
# License
|
|
226
|
+
|
|
227
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
228
|
+
|
|
229
|
+
# Code of Conduct
|
|
230
|
+
|
|
231
|
+
Everyone interacting in the DaisyUI project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mhenrixon/daisyui/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/daisy_ui/updated_at.rb
CHANGED
data/lib/daisy_ui/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: daisyui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikael Henriksson
|
|
@@ -52,6 +52,9 @@ executables:
|
|
|
52
52
|
extensions: []
|
|
53
53
|
extra_rdoc_files: []
|
|
54
54
|
files:
|
|
55
|
+
- CHANGELOG.md
|
|
56
|
+
- LICENSE.txt
|
|
57
|
+
- README.md
|
|
55
58
|
- exe/daisyui-mcp
|
|
56
59
|
- lib/daisy_ui.rb
|
|
57
60
|
- lib/daisy_ui/accordion.rb
|