daisyui 1.0.5 → 1.1.0

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.
@@ -30,6 +30,14 @@ module DaisyUI
30
30
  end
31
31
 
32
32
  register_modifiers(
33
+ # Colors
34
+ # "sm:checkbox-neutral"
35
+ # "@sm:checkbox-neutral"
36
+ # "md:checkbox-neutral"
37
+ # "@md:checkbox-neutral"
38
+ # "lg:checkbox-neutral"
39
+ # "@lg:checkbox-neutral"
40
+ neutral: "checkbox-neutral",
33
41
  # "sm:checkbox-primary"
34
42
  # "@sm:checkbox-primary"
35
43
  # "md:checkbox-primary"
@@ -79,20 +87,14 @@ module DaisyUI
79
87
  # "lg:checkbox-error"
80
88
  # "@lg:checkbox-error"
81
89
  error: "checkbox-error",
82
- # "sm:checkbox-lg"
83
- # "@sm:checkbox-lg"
84
- # "md:checkbox-lg"
85
- # "@md:checkbox-lg"
86
- # "lg:checkbox-lg"
87
- # "@lg:checkbox-lg"
88
- lg: "checkbox-lg",
89
- # "sm:checkbox-md"
90
- # "@sm:checkbox-md"
91
- # "md:checkbox-md"
92
- # "@md:checkbox-md"
93
- # "lg:checkbox-md"
94
- # "@lg:checkbox-md"
95
- md: "checkbox-md",
90
+ # Sizes
91
+ # "sm:checkbox-xs"
92
+ # "@sm:checkbox-xs"
93
+ # "md:checkbox-xs"
94
+ # "@md:checkbox-xs"
95
+ # "lg:checkbox-xs"
96
+ # "@lg:checkbox-xs"
97
+ xs: "checkbox-xs",
96
98
  # "sm:checkbox-sm"
97
99
  # "@sm:checkbox-sm"
98
100
  # "md:checkbox-sm"
@@ -100,13 +102,27 @@ module DaisyUI
100
102
  # "lg:checkbox-sm"
101
103
  # "@lg:checkbox-sm"
102
104
  sm: "checkbox-sm",
103
- # "sm:checkbox-xs"
104
- # "@sm:checkbox-xs"
105
- # "md:checkbox-xs"
106
- # "@md:checkbox-xs"
107
- # "lg:checkbox-xs"
108
- # "@lg:checkbox-xs"
109
- xs: "checkbox-xs"
105
+ # "sm:checkbox-md"
106
+ # "@sm:checkbox-md"
107
+ # "md:checkbox-md"
108
+ # "@md:checkbox-md"
109
+ # "lg:checkbox-md"
110
+ # "@lg:checkbox-md"
111
+ md: "checkbox-md",
112
+ # "sm:checkbox-lg"
113
+ # "@sm:checkbox-lg"
114
+ # "md:checkbox-lg"
115
+ # "@md:checkbox-lg"
116
+ # "lg:checkbox-lg"
117
+ # "@lg:checkbox-lg"
118
+ lg: "checkbox-lg",
119
+ # "sm:checkbox-xl"
120
+ # "@sm:checkbox-xl"
121
+ # "md:checkbox-xl"
122
+ # "@md:checkbox-xl"
123
+ # "lg:checkbox-xl"
124
+ # "@lg:checkbox-xl"
125
+ xl: "checkbox-xl"
110
126
  )
111
127
  end
112
128
  end
@@ -8,11 +8,15 @@ module DaisyUI
8
8
  super
9
9
  end
10
10
 
11
- def view_template(&)
11
+ def view_template
12
12
  if tap_to_close?
13
- details(class: classes, **attributes, &)
13
+ details(class: classes, **attributes) do
14
+ yield self if block_given?
15
+ end
14
16
  else
15
- public_send(as, class: classes, **attributes, &)
17
+ public_send(as, class: classes, **attributes) do
18
+ yield self if block_given?
19
+ end
16
20
  end
17
21
  end
18
22
 
@@ -49,12 +53,33 @@ module DaisyUI
49
53
  end
50
54
 
51
55
  register_modifiers(
52
- # "sm:dropdown-end"
53
- # "@sm:dropdown-end"
54
- # "md:dropdown-end"
55
- # "@md:dropdown-end"
56
- # "lg:dropdown-end"
57
- # "@lg:dropdown-end"
56
+ # Placement
57
+ # "sm:dropdown-start"
58
+ # "@sm:dropdown-start"
59
+ # "md:dropdown-start"
60
+ # "@md:dropdown-start"
61
+ # "lg:dropdown-start"
62
+ # "@lg:dropdown-start"
63
+ # "xl:dropdown-start"
64
+ # "@xl:dropdown-start"
65
+ start: "dropdown-start",
66
+ # "sm:dropdown-center"
67
+ # "@sm:dropdown-center"
68
+ # "md:dropdown-center"
69
+ # "@md:dropdown-center"
70
+ # "lg:dropdown-center"
71
+ # "@lg:dropdown-center"
72
+ # "xl:dropdown-center"
73
+ # "@xl:dropdown-center"
74
+ center: "dropdown-center",
75
+ # "sm:dropdown-end"
76
+ # "@sm:dropdown-end"
77
+ # "md:dropdown-end"
78
+ # "@md:dropdown-end"
79
+ # "lg:dropdown-end"
80
+ # "@lg:dropdown-end"
81
+ # "xl:dropdown-end"
82
+ # "@xl:dropdown-end"
58
83
  end: "dropdown-end",
59
84
  # "sm:dropdown-top"
60
85
  # "@sm:dropdown-top"
@@ -62,6 +87,8 @@ module DaisyUI
62
87
  # "@md:dropdown-top"
63
88
  # "lg:dropdown-top"
64
89
  # "@lg:dropdown-top"
90
+ # "xl:dropdown-top"
91
+ # "@xl:dropdown-top"
65
92
  top: "dropdown-top",
66
93
  # "sm:dropdown-bottom"
67
94
  # "@sm:dropdown-bottom"
@@ -69,6 +96,8 @@ module DaisyUI
69
96
  # "@md:dropdown-bottom"
70
97
  # "lg:dropdown-bottom"
71
98
  # "@lg:dropdown-bottom"
99
+ # "xl:dropdown-bottom"
100
+ # "@xl:dropdown-bottom"
72
101
  bottom: "dropdown-bottom",
73
102
  # "sm:dropdown-left"
74
103
  # "@sm:dropdown-left"
@@ -76,6 +105,8 @@ module DaisyUI
76
105
  # "@md:dropdown-left"
77
106
  # "lg:dropdown-left"
78
107
  # "@lg:dropdown-left"
108
+ # "xl:dropdown-left"
109
+ # "@xl:dropdown-left"
79
110
  left: "dropdown-left",
80
111
  # "sm:dropdown-right"
81
112
  # "@sm:dropdown-right"
@@ -83,13 +114,18 @@ module DaisyUI
83
114
  # "@md:dropdown-right"
84
115
  # "lg:dropdown-right"
85
116
  # "@lg:dropdown-right"
117
+ # "xl:dropdown-right"
118
+ # "@xl:dropdown-right"
86
119
  right: "dropdown-right",
120
+ # Behavior
87
121
  # "sm:dropdown-hover"
88
122
  # "@sm:dropdown-hover"
89
123
  # "md:dropdown-hover"
90
124
  # "@md:dropdown-hover"
91
125
  # "lg:dropdown-hover"
92
126
  # "@lg:dropdown-hover"
127
+ # "xl:dropdown-hover"
128
+ # "@xl:dropdown-hover"
93
129
  hover: "dropdown-hover",
94
130
  # "sm:dropdown-open"
95
131
  # "@sm:dropdown-open"
@@ -97,6 +133,8 @@ module DaisyUI
97
133
  # "@md:dropdown-open"
98
134
  # "lg:dropdown-open"
99
135
  # "@lg:dropdown-open"
136
+ # "xl:dropdown-open"
137
+ # "@xl:dropdown-open"
100
138
  open: "dropdown-open"
101
139
  )
102
140
  end
data/lib/daisy_ui/hero.rb CHANGED
@@ -5,8 +5,10 @@ module DaisyUI
5
5
  class Hero < Base
6
6
  self.component_class = :hero
7
7
 
8
- def view_template(&)
9
- public_send(as, class: classes, **attributes, &)
8
+ def view_template
9
+ public_send(as, class: classes, **attributes) do
10
+ yield self if block_given?
11
+ end
10
12
  end
11
13
 
12
14
  def content(**options, &)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DaisyUI
4
+ class Hover3d < Base
5
+ self.component_class = "hover-3d"
6
+
7
+ GRID_DIVS = 8
8
+
9
+ def view_template(&)
10
+ public_send(as, class: classes, **attributes) do
11
+ yield if block_given?
12
+ GRID_DIVS.times { div }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -5,12 +5,27 @@ module DaisyUI
5
5
  class Indicator < Base
6
6
  self.component_class = :indicator
7
7
 
8
- def view_template(&)
9
- public_send(as, class: classes, **attributes, &)
8
+ def view_template
9
+ public_send(as, class: classes, **attributes) do
10
+ yield self if block_given?
11
+ end
10
12
  end
11
13
 
12
- def item(**options, &)
13
- span(class: component_classes("indicator-item", options:), **options, &)
14
+ def item(*item_modifiers, **options, &)
15
+ item_classes = build_item_classes(item_modifiers, options)
16
+ span(class: item_classes, **options, &)
17
+ end
18
+
19
+ private
20
+
21
+ def build_item_classes(item_modifiers, options)
22
+ # Start with base class
23
+ base = apply_prefix("indicator-item")
24
+ # Add modifier classes from position modifiers
25
+ mod_classes = item_modifiers.filter_map { |m| apply_prefix(modifier_map[m]) }
26
+ # Add custom class if provided
27
+ custom = options.delete(:class)
28
+ merge_classes(base, *mod_classes, custom)
14
29
  end
15
30
 
16
31
  register_modifiers(
data/lib/daisy_ui/link.rb CHANGED
@@ -2,135 +2,32 @@
2
2
 
3
3
  module DaisyUI
4
4
  class Link < Base
5
- self.component_class = nil
5
+ self.component_class = "link"
6
6
 
7
7
  def view_template(&)
8
8
  a(class: classes, **attributes, &)
9
9
  end
10
10
 
11
- private
12
-
13
- attr_reader :link_to_name
14
-
15
11
  register_modifiers(
16
- # "sm:link"
17
- # "@sm:link"
18
- # "md:link"
19
- # "@md:link"
20
- # "lg:link"
21
- # "@lg:link"
22
- underlined: "link",
23
- # "sm:link-hover"
24
- # "@sm:link-hover"
25
- # "md:link-hover"
26
- # "@md:link-hover"
27
- # "lg:link-hover"
28
- # "@lg:link-hover"
12
+ # Style
13
+ # "sm:link-hover" "md:link-hover" "lg:link-hover"
29
14
  hover: "link-hover",
30
- # "sm:active"
31
- # "@sm:active"
32
- # "md:active"
33
- # "@md:active"
34
- # "lg:active"
35
- # "@lg:active"
36
- active: "active",
37
- # "sm:image-full"
38
- # "@sm:image-full"
39
- # "md:image-full"
40
- # "@md:image-full"
41
- # "lg:image-full"
42
- # "@lg:image-full"
43
- image_full: "image-full",
44
- # "sm:card-bordered"
45
- # "@sm:card-bordered"
46
- # "md:card-bordered"
47
- # "@md:card-bordered"
48
- # "lg:card-bordered"
49
- # "@lg:card-bordered"
50
- bordered: "card-bordered",
51
- # "sm:card-normal"
52
- # "@sm:card-normal"
53
- # "md:card-normal"
54
- # "@md:card-normal"
55
- # "lg:card-normal"
56
- # "@lg:card-normal"
57
- normal: "card-normal",
58
- # "sm:card-compact"
59
- # "@sm:card-compact"
60
- # "md:card-compact"
61
- # "@md:card-compact"
62
- # "lg:card-compact"
63
- # "@lg:card-compact"
64
- compact: "card-compact",
65
- # "sm:card-side"
66
- # "@sm:card-side"
67
- # "md:card-side"
68
- # "@md:card-side"
69
- # "lg:card-side"
70
- # "@lg:card-side"
71
- side: "card-side",
72
- # "sm:glass"
73
- # "@sm:glass"
74
- # "md:glass"
75
- # "@md:glass"
76
- # "lg:glass"
77
- # "@lg:glass"
78
- glass: "glass",
79
- # "sm:link-primary"
80
- # "@sm:link-primary"
81
- # "md:link-primary"
82
- # "@md:link-primary"
83
- # "lg:link-primary"
84
- # "@lg:link-primary"
15
+ # Colors
16
+ # "sm:link-neutral" "md:link-neutral" "lg:link-neutral"
17
+ neutral: "link-neutral",
18
+ # "sm:link-primary" "md:link-primary" "lg:link-primary"
85
19
  primary: "link-primary",
86
- # "sm:link-secondary"
87
- # "@sm:link-secondary"
88
- # "md:link-secondary"
89
- # "@md:link-secondary"
90
- # "lg:link-secondary"
91
- # "@lg:link-secondary"
20
+ # "sm:link-secondary" "md:link-secondary" "lg:link-secondary"
92
21
  secondary: "link-secondary",
93
- # "sm:link-accent"
94
- # "@sm:link-accent"
95
- # "md:link-accent"
96
- # "@md:link-accent"
97
- # "lg:link-accent"
98
- # "@lg:link-accent"
22
+ # "sm:link-accent" "md:link-accent" "lg:link-accent"
99
23
  accent: "link-accent",
100
- # "sm:link-neutral"
101
- # "@sm:link-neutral"
102
- # "md:link-neutral"
103
- # "@md:link-neutral"
104
- # "lg:link-neutral"
105
- # "@lg:link-neutral"
106
- neutral: "link-neutral",
107
- # "sm:link-info"
108
- # "@sm:link-info"
109
- # "md:link-info"
110
- # "@md:link-info"
111
- # "lg:link-info"
112
- # "@lg:link-info"
24
+ # "sm:link-info" "md:link-info" "lg:link-info"
113
25
  info: "link-info",
114
- # "sm:link-success"
115
- # "@sm:link-success"
116
- # "md:link-success"
117
- # "@md:link-success"
118
- # "lg:link-success"
119
- # "@lg:link-success"
26
+ # "sm:link-success" "md:link-success" "lg:link-success"
120
27
  success: "link-success",
121
- # "sm:link-warning"
122
- # "@sm:link-warning"
123
- # "md:link-warning"
124
- # "@md:link-warning"
125
- # "lg:link-warning"
126
- # "@lg:link-warning"
28
+ # "sm:link-warning" "md:link-warning" "lg:link-warning"
127
29
  warning: "link-warning",
128
- # "sm:link-error"
129
- # "@sm:link-error"
130
- # "md:link-error"
131
- # "@md:link-error"
132
- # "lg:link-error"
133
- # "@lg:link-error"
30
+ # "sm:link-error" "md:link-error" "lg:link-error"
134
31
  error: "link-error"
135
32
  ).freeze
136
33
  end
@@ -82,7 +82,18 @@ module DaisyUI
82
82
  # "@md:loading-lg"
83
83
  # "lg:loading-lg"
84
84
  # "@lg:loading-lg"
85
+ # "xl:loading-lg"
86
+ # "@xl:loading-lg"
85
87
  lg: "loading-lg",
88
+ # "sm:loading-xl"
89
+ # "@sm:loading-xl"
90
+ # "md:loading-xl"
91
+ # "@md:loading-xl"
92
+ # "lg:loading-xl"
93
+ # "@lg:loading-xl"
94
+ # "xl:loading-xl"
95
+ # "@xl:loading-xl"
96
+ xl: "loading-xl",
86
97
  # "sm:text-primary"
87
98
  # "@sm:text-primary"
88
99
  # "md:text-primary"
data/lib/daisy_ui/mask.rb CHANGED
@@ -72,34 +72,6 @@ module DaisyUI
72
72
  # "lg:mask-circle"
73
73
  # "@lg:mask-circle"
74
74
  circle: "mask-circle",
75
- # "sm:mask-parallelogram"
76
- # "@sm:mask-parallelogram"
77
- # "md:mask-parallelogram"
78
- # "@md:mask-parallelogram"
79
- # "lg:mask-parallelogram"
80
- # "@lg:mask-parallelogram"
81
- parallelogram: "mask-parallelogram",
82
- # "sm:mask-parallelogram-2"
83
- # "@sm:mask-parallelogram-2"
84
- # "md:mask-parallelogram-2"
85
- # "@md:mask-parallelogram-2"
86
- # "lg:mask-parallelogram-2"
87
- # "@lg:mask-parallelogram-2"
88
- parallelogram_2: "mask-parallelogram-2",
89
- # "sm:mask-parallelogram-3"
90
- # "@sm:mask-parallelogram-3"
91
- # "md:mask-parallelogram-3"
92
- # "@md:mask-parallelogram-3"
93
- # "lg:mask-parallelogram-3"
94
- # "@lg:mask-parallelogram-3"
95
- parallelogram_3: "mask-parallelogram-3",
96
- # "sm:mask-parallelogram-4"
97
- # "@sm:mask-parallelogram-4"
98
- # "md:mask-parallelogram-4"
99
- # "@md:mask-parallelogram-4"
100
- # "lg:mask-parallelogram-4"
101
- # "@lg:mask-parallelogram-4"
102
- parallelogram_4: "mask-parallelogram-4",
103
75
  # "sm:mask-star"
104
76
  # "@sm:mask-star"
105
77
  # "md:mask-star"