daisyui 1.25.4 → 2.0.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.
package/README.md CHANGED
@@ -1,22 +1,22 @@
1
1
  <div align="center">
2
2
 
3
- [![][logo-url]][docs-url]
3
+ [![][logo-url]][docs-url]
4
4
 
5
5
  **Tailwind CSS Components**
6
6
  Adds component classes like `btn`, `card` and more to Tailwind CSS
7
7
 
8
8
  [ [See all components][docs-url] ]
9
-
10
- [![][tweet]][tweet-url]
9
+
10
+ [![][tweet]][tweet-url]
11
11
 
12
12
  </div>
13
13
 
14
- [![][banner-url]][docs-url]
14
+ [![][banner-url]][docs-url]
15
15
 
16
- # daisyUI
17
- [![][build]][build-url] [![][npm]][npm-url] [![][number-of-components]][docs-url] [![][license]][license-url]
18
- [![][dl]][npm-url] [![][stars]][gh-url] [![][commit]][gh-url]
16
+ # daisyUI 2.0
19
17
 
18
+ [![][build]][build-url] [![][npm]][npm-url] [![][number-of-components]][docs-url] [![][license]][license-url]
19
+ [![][dl]][npm-url] [![][stars]][gh-url] [![][commit]][gh-url]
20
20
 
21
21
  - 👉 [ [See all components][docs-url] ]
22
22
  - 📘 Documents: [daisyui.com][docs-url]
@@ -25,7 +25,8 @@ Adds component classes like `btn`, `card` and more to Tailwind CSS
25
25
 
26
26
  ---
27
27
 
28
- ## 🌼 Features
28
+ ## 🌼 Features
29
+
29
30
  <details>
30
31
  <summary>
31
32
  show / hide
@@ -50,7 +51,7 @@ Adds component classes like `btn`, `card` and more to Tailwind CSS
50
51
 
51
52
  ---
52
53
 
53
- ## 📀 Install now!
54
+ ## 📀 Install now!
54
55
 
55
56
  ```bash
56
57
  npm i daisyui
@@ -58,135 +59,158 @@ npm i daisyui
58
59
 
59
60
  Then add daisyUI to your `tailwind.config.js`
60
61
  [ [Read more][docs-url-install] ]
62
+
61
63
  ```js
62
64
  module.exports = {
63
-
64
- plugins: [
65
- require('daisyui'),
66
- ],
67
-
68
- }
65
+ plugins: [require("daisyui")],
66
+ };
69
67
  ```
70
68
 
71
-
72
69
  <details>
73
70
  <summary>
74
71
  Or use a CDN
75
72
  </summary>
76
73
 
74
+ Loading CSS files from CDN is not recommended for production. It's better to install Tailwind and daisyUI as Nodejs dependencies so you can config/customize everything, and purge unused styles.\*
77
75
 
78
- Loading CSS files from CDN is not recommended for production. It's better to install Tailwind and daisyUI as Nodejs dependencies so you can config/customize everything, and purge unused styles.*
79
-
80
-
81
76
  ```html
82
- <link href="https://cdn.jsdelivr.net/npm/daisyui@1.25.3/dist/full.css" rel="stylesheet" type="text/css" />
83
- <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2/dist/tailwind.min.css" rel="stylesheet" type="text/css" />
77
+ <link
78
+ href="https://cdn.jsdelivr.net/npm/daisyui@1.25.4/dist/full.css"
79
+ rel="stylesheet"
80
+ type="text/css"
81
+ />
82
+ <link
83
+ href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2/dist/tailwind.min.css"
84
+ rel="stylesheet"
85
+ type="text/css"
86
+ />
84
87
  ```
85
88
 
86
89
  </details>
87
90
 
88
91
  ---
89
- ## 🚀 Use
90
- Use component classes to build your UI.
92
+
93
+ ## 🚀 Use
94
+
95
+ Use component classes to build your UI.
96
+
91
97
  ```html
92
98
  <a class="btn">Hello!</a>
93
99
  ```
100
+
94
101
  ```html
95
- <input type="checkbox" class="checkbox"/>
102
+ <input type="checkbox" class="checkbox" />
96
103
  ```
104
+
97
105
  ```html
98
- <input type="checkbox" class="toggle"/>
106
+ <input type="checkbox" class="toggle" />
99
107
  ```
108
+
100
109
  ```html
101
- <div class="alert alert-success">
102
- Message sent successfully
103
- </div>
110
+ <div class="alert alert-success">Message sent successfully</div>
104
111
  ```
105
112
 
106
113
  👉 [See all components][docs-url]
107
- 🎲 [Try it online][tw-play-url]
114
+ 🎲 [Try it online][tw-play-url]
108
115
 
109
116
  ---
110
117
 
111
- ## 📘 Documents + Examples
118
+ ## 📘 Documents + Examples
119
+
112
120
  See the official site:
113
121
  [ [daisyui.com][docs-url] ↗︎ ]
114
122
 
115
123
  ---
116
124
 
117
- ## 🤝 Contributing
125
+ ## 🤝 Contributing
126
+
118
127
  Read the documents for more info:
119
128
  [ [Read contribution guide](https://github.com/saadeghi/daisyui/blob/master/.github/CONTRIBUTING.md) ]
120
129
 
121
130
  ---
131
+
122
132
  ## List of Components
133
+
123
134
  <details>
124
135
  <summary>
125
136
  show / hide
126
137
  </summary>
127
138
 
128
- - [x] Alert
129
- - [x] Artboard
130
- - [ ] App bar
131
- - [x] Avatar
132
- - [x] Avatar group
133
- - [x] Badge
134
- - [ ] Banner
135
- - [x] Breadcrumb
136
- - [x] Button
137
- - [x] Button group
138
- - [ ] Calendar
139
- - [x] Carousel
140
- - [x] Card
141
- - [ ] Chat bubble
142
- - [x] Collapse (Accordion)
143
- - [ ] Comment
144
- - [x] Countdown
145
- - [ ] Cover
146
- - [x] Divider
147
- - [x] Drawer
148
- - [ ] Empty placeholder
149
- - [x] Footer
150
- - [ ] Form
151
- - [x] Select
152
- - [x] Text input
153
- - [x] Text area
139
+ - Actions
140
+ - [x] Button
141
+ - [x] Dropdown
142
+ - [x] Modal
143
+ - [x] Swap
144
+
145
+ - Data display
146
+ - [x] Alert
147
+ - [x] Avatar
148
+ - [x] Badge
149
+ - [ ] Banner
150
+ - [ ] Calendar
151
+ - [x] Card
152
+ - [x] Carousel
153
+ - [ ] Chat bubble
154
+ - [x] Collapse
155
+ - [ ] Comment
156
+ - [x] Countdown
157
+ - [ ] Empty placeholder
158
+ - [x] Kbd
159
+ - [ ] Loading
160
+ - [x] Progress
161
+ - [x] Radial progress
162
+ - [x] Stat
163
+ - [x] Table
164
+ - [ ] Tag
165
+ - [ ] Timeline
166
+ - [ ] Toast
167
+ - [x] Tooltip
168
+ - [ ] Treeview
169
+
170
+ - Data input
154
171
  - [x] Checkbox
172
+ - [x] Text input
155
173
  - [x] Radio
156
- - [x] Range slider
174
+ - [x] Range
157
175
  - [x] Rating
176
+ - [x] Select
177
+ - [x] Textarea
158
178
  - [x] Toggle
159
179
  - [ ] Upload
160
- - [x] Hero
161
- - [x] Indicator
162
- - [x] Kbd
163
- - [x] Link
164
- - [ ] Loading
165
- - [x] Menu
166
- - [ ] Mockup
180
+
181
+ - Layout
182
+ - [x] Artboard
183
+ - [x] Button group
184
+ - [x] Divider
185
+ - [x] Drawer
186
+ - [x] Footer
187
+ - [x] Hero
188
+ - [x] Indicator
189
+ - [x] Input group
190
+ - [x] Mask
191
+ - [x] Stack
192
+
193
+ - Navigation
194
+ - [ ] App bar
195
+ - [x] Breadcrumbs
196
+ - [x] Link
197
+ - [x] Menu
198
+ - [x] Navbar
199
+ - [x] Pagination
200
+ - [x] Steps
201
+ - [x] Tab
202
+
203
+ - Mockup
167
204
  - [ ] Browser
168
205
  - [x] Code
169
206
  - [x] Phone
170
207
  - [x] Window
171
- - [x] Navbar
172
- - [x] Mask
173
- - [x] Modal
174
- - [x] Pagination
175
- - [x] Progress
176
- - [x] Stack
177
- - [x] Stat
178
- - [x] Steps
179
- - [ ] Tag
180
- - [x] Table
181
- - [x] Tabs
182
- - [ ] Timeline
183
- - [ ] Toast
184
- - [x] Tooltip
185
- - [ ] Treeview
208
+
186
209
 
187
210
  </details>
188
211
 
189
212
  ---
213
+
190
214
  ## Featured on:
191
215
 
192
216
  <details>
@@ -215,6 +239,7 @@ Read the documents for more info:
215
239
  - [How to use daisyUI in SvelteKit?](https://www.youtube.com/watch?v=haKnkk6ds20)
216
240
  - [DaisyUI Untuk Yang Mau Pindah ke TailwindCSS dari Bootstrap (Indonesian)](https://www.youtube.com/watch?v=Wm2g6FWec34)
217
241
  - [Next.js - Tailwind - DeisyUI Setup](https://www.youtube.com/watch?v=uXQgJbUj3PQ)
242
+ - [Svelte Setup with Vite, Tailwind, DaisyUI. Custom Themes!](https://www.youtube.com/watch?v=5lF5PxBJoso)
218
243
  - Courses
219
244
  - [Building with SvelteKit and GraphCMS](https://explorers.netlify.com/learn/building-with-sveltekit-and-graphcms)
220
245
  - [Svelte for Beginners by Mike Karan](https://www.udemy.com/course/svelte-for-beginners/)
@@ -226,18 +251,16 @@ Read the documents for more info:
226
251
  </details>
227
252
 
228
253
  ---
229
-
254
+
230
255
  <div align="center">
231
256
 
232
257
 
233
258
  ༼ つ ◕_◕ ༽つ Please share
234
259
 
235
- [![][tweet]][tweet-url]
260
+ [![][tweet]][tweet-url]
236
261
 
237
262
  </div>
238
263
 
239
-
240
-
241
264
  [install-size]: https://badgen.net/bundlephobia/minzip/daisyui?label=bundle%20size&color=green
242
265
  [build]: https://badgen.net/github/checks/saadeghi/daisyui?label=build
243
266
  [npm]: https://badgen.net/github/tag/saadeghi/daisyui?label=version&color=green
@@ -246,7 +269,6 @@ Read the documents for more info:
246
269
  [license]: https://badgen.net/github/license/saadeghi/daisyui?color=green
247
270
  [stars]: https://badgen.net/github/stars/saadeghi/daisyui?color=green
248
271
  [tweet]: https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fsaadeghi%2Fdaisyui
249
-
250
272
  [install-size-url]: https://bundlephobia.com/result?p=daisyui
251
273
  [license-url]: https://github.com/saadeghi/daisyui/blob/master/LICENSE
252
274
  [npm-url]: https://www.npmjs.com/package/daisyui
@@ -258,11 +280,8 @@ Read the documents for more info:
258
280
  [jsdeliver-url]: https://www.jsdelivr.com/package/npm/daisyui
259
281
  [build-url]: https://github.com/saadeghi/daisyui/actions
260
282
  [tweet-url]: https://twitter.com/intent/tweet?text=daisyUI%20%0D%0AUI%20Components%20for%20Tailwind%20CSS%20%0D%0Ahttps://github.com/saadeghi/daisyui
261
- [number-of-components]: https://badgen.net/badge/total%20components/41/green
262
-
283
+ [number-of-components]: https://badgen.net/badge/total%20components/45/green
263
284
  [docs-url-install]: https://daisyui.com/docs/install
264
285
  [docs-url]: https://daisyui.com/
265
286
  [logo-url]: https://raw.githubusercontent.com/saadeghi/files/main/daisyui/logo-4.svg
266
287
  [banner-url]: https://raw.githubusercontent.com/saadeghi/files/main/daisyui/card-3.png
267
-
268
-
@@ -1,27 +1,34 @@
1
1
  module.exports = {
2
- "primary" : "--p",
3
- "primary-focus" : "--pf",
4
- "primary-content" : "--pc",
5
-
6
- "secondary" : "--s",
7
- "secondary-focus" : "--sf",
8
- "secondary-content" : "--sc",
9
-
10
- "accent" : "--a",
11
- "accent-focus" : "--af",
12
- "accent-content" : "--ac",
13
-
14
- "neutral" : "--n",
15
- "neutral-focus" : "--nf",
16
- "neutral-content" : "--nc",
17
-
18
- "base-100" : "--b1",
19
- "base-200" : "--b2",
20
- "base-300" : "--b3",
21
- "base-content" : "--bc",
22
-
23
- "info" : "--in",
24
- "success" : "--su",
25
- "warning" : "--wa",
26
- "error" : "--er",
27
- }
2
+ primary: "--p",
3
+ "primary-focus": "--pf",
4
+ "primary-content": "--pc",
5
+
6
+ secondary: "--s",
7
+ "secondary-focus": "--sf",
8
+ "secondary-content": "--sc",
9
+
10
+ accent: "--a",
11
+ "accent-focus": "--af",
12
+ "accent-content": "--ac",
13
+
14
+ neutral: "--n",
15
+ "neutral-focus": "--nf",
16
+ "neutral-content": "--nc",
17
+
18
+ "base-100": "--b1",
19
+ "base-200": "--b2",
20
+ "base-300": "--b3",
21
+ "base-content": "--bc",
22
+
23
+ info: "--in",
24
+ "info-content": "--inc",
25
+
26
+ success: "--su",
27
+ "success-content": "--suc",
28
+
29
+ warning: "--wa",
30
+ "warning-content": "--wac",
31
+
32
+ error: "--er",
33
+ "error-content": "--erc",
34
+ };
package/colors/index.js CHANGED
@@ -1,20 +1,52 @@
1
- const colorValues = require('./colorNames')
2
-
3
- let colorObject = {
4
- "transparent": "transparent",
5
- "current": "currentColor",
6
- }
7
-
8
- for (const [key, item] of Object.entries(colorValues)) {
9
- colorObject[key] = ({ opacityVariable, opacityValue }) => {
10
- if (opacityValue !== undefined) {
11
- return `hsla(var(`+ item +`) / ${opacityValue})`
1
+ function withOpacityValue(variable, fallbackColor) {
2
+ return ({ opacityValue }) => {
3
+ let fallbackColorValue = "";
4
+ if (fallbackColor) {
5
+ fallbackColorValue = `, var(${fallbackColor})`;
12
6
  }
13
- if (opacityVariable !== undefined) {
14
- return `hsla(var(`+ item +`) / var(${opacityVariable}, 1))`
7
+ if (opacityValue === undefined) {
8
+ return `hsl(var(${variable}${fallbackColorValue}))`;
15
9
  }
16
- return `hsl(var(`+ item +`))`
17
- }
10
+ return `hsl(var(${variable}${fallbackColorValue}) / ${opacityValue})`;
11
+ };
18
12
  }
19
13
 
20
- module.exports = colorObject
14
+ let colorObject = {
15
+ transparent: "transparent",
16
+ current: "currentColor",
17
+
18
+ primary: withOpacityValue("--p"),
19
+ "primary-focus": withOpacityValue("--pf", "--p"),
20
+ "primary-content": withOpacityValue("--pc"),
21
+
22
+ secondary: withOpacityValue("--s"),
23
+ "secondary-focus": withOpacityValue("--sf", "--s"),
24
+ "secondary-content": withOpacityValue("--sc"),
25
+
26
+ accent: withOpacityValue("--a"),
27
+ "accent-focus": withOpacityValue("--af", "--a"),
28
+ "accent-content": withOpacityValue("--ac"),
29
+
30
+ neutral: withOpacityValue("--n"),
31
+ "neutral-focus": withOpacityValue("--nf", "--n"),
32
+ "neutral-content": withOpacityValue("--nc"),
33
+
34
+ "base-100": withOpacityValue("--b1"),
35
+ "base-200": withOpacityValue("--b2", "--b1"),
36
+ "base-300": withOpacityValue("--b3", "--b2"),
37
+ "base-content": withOpacityValue("--bc"),
38
+
39
+ info: withOpacityValue("--in"),
40
+ "info-content": withOpacityValue("--inc", "--nc"),
41
+
42
+ success: withOpacityValue("--su"),
43
+ "success-content": withOpacityValue("--suc", "--nc"),
44
+
45
+ warning: withOpacityValue("--wa"),
46
+ "warning-content": withOpacityValue("--wac", "--nc"),
47
+
48
+ error: withOpacityValue("--er"),
49
+ "error-content": withOpacityValue("--erc", "--nc"),
50
+ };
51
+
52
+ module.exports = colorObject;