daisyui 4.2.0 → 4.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daisyui",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "daisyUI - Tailwind CSS Components",
5
5
  "author": "Pouya Saadeghi",
6
6
  "license": "MIT",
package/src/index.js CHANGED
@@ -7,12 +7,12 @@ import { magenta, dim, yellow, blue, reset, green } from "picocolors"
7
7
  import postcssPrefix from "./lib/addPrefix"
8
8
 
9
9
  import { version, funding } from "../package.json"
10
- import utilities from "../dist/utilities"
11
- import base from "../dist/base"
12
- import unstyled from "../dist/unstyled"
13
- import styled from "../dist/styled"
14
- import utilitiesUnstyled from "../dist/utilities-unstyled"
15
- import utilitiesStyled from "../dist/utilities-styled"
10
+ import utilities from "../dist/utilities.cjs"
11
+ import base from "../dist/base.cjs"
12
+ import unstyled from "../dist/unstyled.cjs"
13
+ import styled from "../dist/styled.cjs"
14
+ import utilitiesUnstyled from "../dist/utilities-unstyled.cjs"
15
+ import utilitiesStyled from "../dist/utilities-styled.cjs"
16
16
  import { themes } from "./theming/themes"
17
17
  import { injectThemes } from "./theming/functions"
18
18
  import { utilityClasses } from "./lib/utility-classes"
@@ -12,8 +12,7 @@ export function isDark(color) {
12
12
  }
13
13
  return false
14
14
  }
15
- export function colorObjToString(input) {
16
- const { l, c, h } = input
15
+ export function colorObjToString({ l, c, h }) {
17
16
  return `${cutNumber(l)} ${cutNumber(c)} ${cutNumber(h)}`
18
17
  }
19
18
  export function generateForegroundColorFrom(input, percentage = 0.8) {
@@ -32,7 +31,7 @@ export function convertColorFormat(input) {
32
31
  const resultObj = {}
33
32
 
34
33
  Object.entries(input).forEach(([rule, value]) => {
35
- if (colorNames.hasOwnProperty(rule)) {
34
+ if (Object.hasOwn(colorNames, rule)) {
36
35
  const colorObj = toGamutOKLCH(value)
37
36
  resultObj[colorNames[rule]] = colorObjToString(colorObj)
38
37
  } else {
@@ -114,15 +113,14 @@ export function convertColorFormat(input) {
114
113
  }
115
114
 
116
115
  // add css variables if not exist
117
- Object.entries(variables).forEach((item) => {
118
- const [variable, value] = item
116
+ Object.entries(variables).forEach(([variable, value]) => {
119
117
  if (!Object.hasOwn(input, variable)) {
120
118
  resultObj[variable] = value
121
119
  }
122
120
  })
123
121
 
124
122
  // add other custom styles
125
- if (!colorNames.hasOwnProperty(rule)) {
123
+ if (!Object.hasOwn(colorNames, rule)) {
126
124
  resultObj[rule] = value
127
125
  }
128
126
  })