Current section

41 Versions

Jump to

Compare versions

26 files changed
+513 additions
-133 deletions
  @@ -25,7 +25,7 @@ Reference this repository on your `mix.exs` file to start using.
25 25 ```elixir
26 26 def deps do
27 27 [
28 - {:daisy_ui_components, "~> 0.7"}
28 + {:daisy_ui_components, "~> 0.8"}
29 29 ]
30 30 end
31 31 ```
  @@ -34,7 +34,7 @@ Add through `npm` the daisy UI package inside your phoenix application:
34 34
35 35 ```bash
36 36 cd assets
37 - npm i -D daisyui@latest
37 + npm i -D daisyui@5
38 38 ```
39 39
40 40 On `tailwind.config.js` include Live DaisyUI Components under the content list and reference under plugins
  @@ -43,17 +43,17 @@ On `tailwind.config.js` include Live DaisyUI Components under the content list a
43 43 module.exports = {
44 44 content: [
45 45 //...
46 - "../deps/daisy_ui_components/**/*.*ex" // <- reference DaisyUIComponents as content path
46 + "../deps/daisy_ui_components/**/*.*ex", // <- reference DaisyUIComponents as content path
47 47 ],
48 48 //...
49 49 plugins: [
50 50 //...
51 51 // comment the tailwind form to not conflict with DaisyUI
52 52 // require("@tailwindcss/forms"),
53 - require("daisyui") <- // add daisyUI plugin
53 + require("daisyui"), // <- add daisyUI plugin
54 54 //...
55 - ]
56 - }
55 + ],
56 + };
57 57 ```
58 58
59 59 Add error translation function to your app's config.exs file. This function is used to translate ecto changeset errors
  @@ -171,16 +171,16 @@ List of available components.
171 171
172 172 ### Navigation
173 173
174 - | Component | Status | Storybook |
175 - | ---------------------------------------------------------------------- | ------ | --------- |
176 - | [Breadcrumbs](https://daisyui.com/components/breadcrumbs) | âś… | âś… |
177 - | [Bottom navigation](https://daisyui.com/components/bottom-navigation/) | ❌ | ❌ |
178 - | [Link](https://daisyui.com/components/link) | ❌ | ❌ |
179 - | [Menu](https://daisyui.com/components/menu) | âś… | âś… |
180 - | [Navbar](https://daisyui.com/components/navbar) | âś… | âś… |
181 - | [Pagination](https://daisyui.com/components/pagination) | âś… | âś… |
182 - | [Steps](https://daisyui.com/components/steps) | ❌ | ❌ |
183 - | [Tabs](https://daisyui.com/components/tab) | ❌ | ❌ |
174 + | Component | Status | Storybook |
175 + | --------------------------------------------------------- | ------ | --------- |
176 + | [Breadcrumbs](https://daisyui.com/components/breadcrumbs) | âś… | âś… |
177 + | [Dock](https://daisyui.com/components/dock/) | ❌ | ❌ |
178 + | [Link](https://daisyui.com/components/link) | ❌ | ❌ |
179 + | [Menu](https://daisyui.com/components/menu) | âś… | âś… |
180 + | [Navbar](https://daisyui.com/components/navbar) | âś… | âś… |
181 + | [Pagination](https://daisyui.com/components/pagination) | âś… | âś… |
182 + | [Steps](https://daisyui.com/components/steps) | ❌ | ❌ |
183 + | [Tabs](https://daisyui.com/components/tab) | ❌ | ❌ |
184 184
185 185 ### Feedback
186 186
  @@ -188,7 +188,7 @@ List of available components.
188 188 | ----------------------------------------------------------------- | ------ | --------- |
189 189 | [Alert](https://daisyui.com/components/alert) | âś… | âś… |
190 190 | [Loading](https://daisyui.com/components/loading/) | âś… | âś… |
191 - | [Progress](https://daisyui.com/components/progress) | ❌ | ❌ |
191 + | [Progress](https://daisyui.com/components/progress) | âś… | âś… |
192 192 | [Radial progress](https://daisyui.com/components/radial-progress) | ❌ | ❌ |
193 193 | [Skeleton](https://daisyui.com/components/skeleton/) | ❌ | ❌ |
194 194 | [Toast](https://daisyui.com/components/toast) | ❌ | ❌ |
  @@ -199,7 +199,9 @@ List of available components.
199 199 | Component | Status | Storybook |
200 200 | ------------------------------------------------------- | ------ | --------- |
201 201 | [Checkbox](https://daisyui.com/components/checkbox) | âś… | âś… |
202 + | [Fieldset](https://daisyui.com/components/fieldset) | âś… | âś… |
202 203 | [File input](https://daisyui.com/components/file-input) | ❌ | ❌ |
204 + | [Label](https://daisyui.com/components/label) | âś… | âś… |
203 205 | [Radio](https://daisyui.com/components/radio) | âś… | âś… |
204 206 | [Range](https://daisyui.com/components/range) | âś… | âś… |
205 207 | [Rating](https://daisyui.com/components/rating) | ❌ | ❌ |
  @@ -207,6 +209,7 @@ List of available components.
207 209 | [Text Input](https://daisyui.com/components/input) | âś… | âś… |
208 210 | [Textarea](https://daisyui.com/components/textarea) | âś… | âś… |
209 211 | [Toggle](https://daisyui.com/components/toggle) | âś… | âś… |
212 + | [Validator](https://daisyui.com/components/validator) | âś… | âś… |
210 213
211 214 ### Layout
212 215
  @@ -215,7 +218,7 @@ List of available components.
215 218 | [Artboard](https://daisyui.com/components/artboard) | ❌ | ❌ |
216 219 | [Divider](https://daisyui.com/components/divider) | ❌ | ❌ |
217 220 | [Drawer](https://daisyui.com/components/drawer) | âś… | âś… |
218 - | [Footer](https://daisyui.com/components/footer) | ❌ | ❌ |
221 + | [Footer](https://daisyui.com/components/footer) | âś… | âś… |
219 222 | [Hero](https://daisyui.com/components/hero) | âś… | âś… |
220 223 | [Indicator](https://daisyui.com/components/indicator) | âś… | âś… |
221 224 | [Join](https://daisyui.com/components/join) | âś… | âś… |
  @@ -244,6 +247,7 @@ List of available components.
244 247
245 248 ## 🗺️ Roadmap
246 249
247 - - Implement all components
250 + - Update components for the new [DaisyUI 5](https://daisyui.com/docs/upgrade/)
251 + - Implement all components from DaisyUI
248 252 - Document all components in Storybook
249 253 - Create `mix` script to enable users to import the components of this library into their projects, sharing the same project namespace.
  @@ -1,7 +1,7 @@
1 1 {<<"links">>,
2 2 [{<<"GitHub">>,<<"https://github.com/phcurado/daisy_ui_components">>}]}.
3 3 {<<"name">>,<<"daisy_ui_components">>}.
4 - {<<"version">>,<<"0.7.6">>}.
4 + {<<"version">>,<<"0.8.0">>}.
5 5 {<<"description">>,<<"DaisyUI component library for LiveView">>}.
6 6 {<<"elixir">>,<<"~> 1.14">>}.
7 7 {<<"app">>,<<"daisy_ui_components">>}.
  @@ -20,7 +20,9 @@
20 20 <<"lib/daisy_ui_components/modal.ex">>,
21 21 <<"lib/daisy_ui_components/hero.ex">>,
22 22 <<"lib/daisy_ui_components/navbar.ex">>,
23 + <<"lib/daisy_ui_components/progress.ex">>,
23 24 <<"lib/daisy_ui_components/badge.ex">>,
25 + <<"lib/daisy_ui_components/footer.ex">>,
24 26 <<"lib/daisy_ui_components/table.ex">>,
25 27 <<"lib/daisy_ui_components/dropdown.ex">>,
26 28 <<"lib/daisy_ui_components/js_helpers.ex">>,
  @@ -30,10 +32,12 @@
30 32 <<"lib/daisy_ui_components/checkbox.ex">>,
31 33 <<"lib/daisy_ui_components/select.ex">>,
32 34 <<"lib/daisy_ui_components/alert.ex">>,
35 + <<"lib/daisy_ui_components/label.ex">>,
33 36 <<"lib/daisy_ui_components/form.ex">>,
34 37 <<"lib/daisy_ui_components/toggle.ex">>,
35 38 <<"lib/daisy_ui_components/breadcrumbs.ex">>,
36 39 <<"lib/daisy_ui_components/icon.ex">>,
40 + <<"lib/daisy_ui_components/fieldset.ex">>,
37 41 <<"lib/daisy_ui_components/sidebar.ex">>,
38 42 <<"lib/daisy_ui_components/text_input.ex">>,
39 43 <<"lib/daisy_ui_components/indicator.ex">>,
  @@ -52,6 +52,8 @@ defmodule DaisyUIComponents do
52 52 import DaisyUIComponents.Checkbox
53 53 import DaisyUIComponents.Drawer
54 54 import DaisyUIComponents.Dropdown
55 + import DaisyUIComponents.Fieldset
56 + import DaisyUIComponents.Footer
55 57 import DaisyUIComponents.Form
56 58 import DaisyUIComponents.Header
57 59 import DaisyUIComponents.Hero
  @@ -60,12 +62,14 @@ defmodule DaisyUIComponents do
60 62 import DaisyUIComponents.Input
61 63 import DaisyUIComponents.Join
62 64 import DaisyUIComponents.JSHelpers
65 + import DaisyUIComponents.Label
63 66 import DaisyUIComponents.List
64 67 import DaisyUIComponents.Loading
65 68 import DaisyUIComponents.Menu
66 69 import DaisyUIComponents.Modal
67 70 import DaisyUIComponents.Navbar
68 71 import DaisyUIComponents.Pagination
72 + import DaisyUIComponents.Progress
69 73 import DaisyUIComponents.Radio
70 74 import DaisyUIComponents.Range
71 75 import DaisyUIComponents.Select
  @@ -22,7 +22,7 @@ defmodule DaisyUIComponents.Avatar do
22 22 classes([
23 23 "avatar",
24 24 add_online_or_offline_class(assigns[:online], assigns[:offline]),
25 - maybe_add_class(assigns.placeholder, "placeholder"),
25 + maybe_add_class(assigns.placeholder, "avatar-placeholder"),
26 26 assigns.class
27 27 ])
28 28 )
  @@ -46,7 +46,7 @@ defmodule DaisyUIComponents.Avatar do
46 46 """
47 47 end
48 48
49 - defp add_online_or_offline_class(true = _online, _offline), do: "online"
50 - defp add_online_or_offline_class(_online, true = _offline), do: "offline"
49 + defp add_online_or_offline_class(true = _online, _offline), do: "avatar-online"
50 + defp add_online_or_offline_class(_online, true = _offline), do: "avatar-offline"
51 51 defp add_online_or_offline_class(_online, _offline), do: nil
52 52 end
  @@ -7,6 +7,11 @@ defmodule DaisyUIComponents.Badge do
7 7
8 8 use DaisyUIComponents, :component
9 9
10 + @colors ~w(neutral) ++ colors()
11 +
12 + @doc false
13 + def badge_colors, do: @colors
14 +
10 15 @doc """
11 16 Renders a badge.
12 17
  @@ -16,7 +21,7 @@ defmodule DaisyUIComponents.Badge do
16 21 <.badge primary class="gap-2">Primary</.badge>
17 22 """
18 23 attr :class, :string, default: nil
19 - attr :color, :string, values: colors() ++ ["neutral"]
24 + attr :color, :string, values: @colors
20 25 attr :ghost, :boolean, default: false
21 26 attr :outline, :boolean, default: false
22 27 attr :size, :string, values: sizes()
  @@ -61,5 +66,6 @@ defmodule DaisyUIComponents.Badge do
61 66 defp badge_size("sm"), do: "badge-sm"
62 67 defp badge_size("md"), do: "badge-md"
63 68 defp badge_size("lg"), do: "badge-lg"
69 + defp badge_size("xl"), do: "badge-xl"
64 70 defp badge_size(_size), do: nil
65 71 end
Loading more files…