@luminescent/ui 1.0.5 → 1.1.3
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/lib/components/bg.js +36 -0
- package/lib/components/btn.js +9 -0
- package/lib/components/card.js +9 -0
- package/lib/components/input.js +9 -0
- package/lib/components/loading.js +7 -0
- package/lib/components/pad.js +24 -0
- package/lib/index.js +8 -0
- package/lib/index.qwik.cjs +2730 -0
- package/lib/index.qwik.mjs +2730 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib-types/components/bg.d.ts +2 -0
- package/lib-types/components/btn.d.ts +3 -0
- package/lib-types/components/card.d.ts +3 -0
- package/lib-types/components/docs/Anchor.d.ts +2 -0
- package/lib-types/components/docs/Blobs.d.ts +2 -0
- package/lib-types/components/docs/Button.d.ts +2 -0
- package/lib-types/components/docs/Card.d.ts +2 -0
- package/lib-types/components/docs/ColorInput.d.ts +2 -0
- package/lib-types/components/docs/ColorPicker.d.ts +2 -0
- package/lib-types/components/docs/Dropdown.d.ts +2 -0
- package/lib-types/components/docs/IconsLogos.d.ts +2 -0
- package/lib-types/components/docs/Nav.d.ts +2 -0
- package/lib-types/components/docs/NumberInput.d.ts +2 -0
- package/lib-types/components/docs/TextArea.d.ts +2 -0
- package/lib-types/components/docs/TextInput.d.ts +2 -0
- package/lib-types/components/docs/Toggle.d.ts +2 -0
- package/lib-types/components/elements/Anchor.d.ts +5 -0
- package/lib-types/components/elements/Blobs.d.ts +36 -0
- package/lib-types/components/elements/Button.d.ts +182 -0
- package/lib-types/components/elements/Card.d.ts +159 -0
- package/lib-types/components/elements/ColorInput.d.ts +12 -0
- package/lib-types/components/elements/ColorPicker.d.ts +15 -0
- package/lib-types/components/elements/Dropdown.d.ts +22 -0
- package/lib-types/components/elements/Header.d.ts +12 -0
- package/lib-types/components/elements/LoadingIcon.d.ts +10 -0
- package/lib-types/components/elements/Nav.d.ts +38 -0
- package/lib-types/components/elements/NumberInput.d.ts +23 -0
- package/lib-types/components/elements/TextArea.d.ts +15 -0
- package/lib-types/components/elements/TextInput.d.ts +43 -0
- package/lib-types/components/elements/Toggle.d.ts +212 -0
- package/lib-types/components/elements.d.ts +13 -0
- package/lib-types/components/input.d.ts +3 -0
- package/lib-types/components/loading.d.ts +2 -0
- package/lib-types/components/logos/Birdflop.d.ts +7 -0
- package/lib-types/components/logos/Discord.d.ts +2 -0
- package/lib-types/components/logos/Fabric.d.ts +2 -0
- package/lib-types/components/logos/Forge.d.ts +2 -0
- package/lib-types/components/logos/IconProps.d.ts +3 -0
- package/lib-types/components/logos/Luminescent.d.ts +3 -0
- package/lib-types/components/logos/Paper.d.ts +2 -0
- package/lib-types/components/logos/Pterodactyl.d.ts +2 -0
- package/lib-types/components/logos/Purpur.d.ts +2 -0
- package/lib-types/components/logos/Velocity.d.ts +2 -0
- package/lib-types/components/logos/Waterfall.d.ts +2 -0
- package/lib-types/components/logos.d.ts +10 -0
- package/lib-types/components/pad.d.ts +2 -0
- package/lib-types/entry.dev.d.ts +2 -0
- package/lib-types/entry.ssr.d.ts +14 -0
- package/lib-types/index.d.ts +5 -0
- package/lib-types/root.d.ts +3 -0
- package/lib-types/svg/ChevronDown.d.ts +2 -0
- package/lib-types/svg/Link.d.ts +2 -0
- package/lib-types/svg/Minus.d.ts +2 -0
- package/lib-types/svg/Plus.d.ts +2 -0
- package/lib-types/svg/Shuffle.d.ts +2 -0
- package/lib-types/utils/color.d.ts +36 -0
- package/package.json +9 -10
- package/src/components/bg.ts +0 -38
- package/src/components/btn.ts +0 -9
- package/src/components/card.ts +0 -9
- package/src/components/input.ts +0 -9
- package/src/components/loading.ts +0 -9
- package/src/components/pad.ts +0 -60
- package/src/index.ts +0 -9
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default function ({ matchUtilities, theme }) {
|
|
2
|
+
const colors = {};
|
|
3
|
+
Object.entries(theme('colors')).forEach(([color, value]) => {
|
|
4
|
+
if (typeof value == 'string') {
|
|
5
|
+
colors[color] = color;
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
Object.keys(value).forEach((shade) => {
|
|
9
|
+
colors[`${color}-${shade}`] = `${color}.${shade}`;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
matchUtilities({
|
|
14
|
+
'lum-bg': (value) => {
|
|
15
|
+
var _a, _b, _c, _d, _e;
|
|
16
|
+
const color = value.split('.')[0];
|
|
17
|
+
const shades = Object.values(colors).filter((c) => {
|
|
18
|
+
return c.startsWith(color);
|
|
19
|
+
});
|
|
20
|
+
const index = shades.indexOf(value);
|
|
21
|
+
const borderColor = shades[index - 1 < 0 ? shades.length - 1 : index - 1] || shades[index + 1 > shades.length - 1 ? 0 : index + 1];
|
|
22
|
+
const textColor = shades[index - 5 < 0 ? shades.length - 1 : index - 5] || shades[index + 5 > shades.length - 1 ? 0 : index + 5];
|
|
23
|
+
return {
|
|
24
|
+
background: (_a = theme(`colors.${value}`)) !== null && _a !== void 0 ? _a : value,
|
|
25
|
+
color: textColor == value ? 'inherit' : (_b = theme(`colors.${textColor}`)) !== null && _b !== void 0 ? _b : 'inherit',
|
|
26
|
+
border: `1px solid ${(_d = (_c = theme(`colors.${borderColor !== null && borderColor !== void 0 ? borderColor : value}`)) !== null && _c !== void 0 ? _c : borderColor) !== null && _d !== void 0 ? _d : value}`,
|
|
27
|
+
outline: 'none',
|
|
28
|
+
'&:focus': {
|
|
29
|
+
border: `1px solid ${(_e = theme(`colors.${textColor}`)) !== null && _e !== void 0 ? _e : 'inherit'}`,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
values: colors,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const defaultClasses = 'lum-pad-md text-base lum-bg-gray-800 hover:lum-bg-gray-700 rounded-md';
|
|
2
|
+
export default function ({ addComponents }) {
|
|
3
|
+
addComponents({
|
|
4
|
+
'.lum-btn': {
|
|
5
|
+
'@apply flex items-center gap-3 motion-safe:transition ease-in-out disabled:opacity-50 hover:drop-shadow-lg motion-safe:active:scale-95 whitespace-nowrap touch-manipulation select-none text-center': {},
|
|
6
|
+
[`@apply ${defaultClasses}`]: {},
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const defaultClasses = 'lum-bg-gray-900 lum-pad-equal-4xl rounded-lg';
|
|
2
|
+
export default function ({ addComponents }) {
|
|
3
|
+
addComponents({
|
|
4
|
+
'.lum-card': {
|
|
5
|
+
'@apply flex flex-col gap-3 motion-safe:transition ease-in-out whitespace-nowrap': {},
|
|
6
|
+
[`@apply ${defaultClasses}`]: {},
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const defaultClasses = 'lum-pad-sm text-sm lum-bg-gray-800 hover:lum-bg-gray-700 rounded-md';
|
|
2
|
+
export default function ({ addComponents }) {
|
|
3
|
+
addComponents({
|
|
4
|
+
'.lum-input': {
|
|
5
|
+
'@apply flex motion-safe:transition ease-in-out disabled:opacity-50 hover:drop-shadow-lg whitespace-nowrap touch-manipulation select-none': {},
|
|
6
|
+
[`@apply ${defaultClasses}`]: {},
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const padding = {
|
|
2
|
+
xs: ['2.5', '1.5'],
|
|
3
|
+
sm: ['3', '2'],
|
|
4
|
+
md: ['4', '2'],
|
|
5
|
+
lg: ['7', '4'],
|
|
6
|
+
xl: ['8', '4'],
|
|
7
|
+
'2xl': ['10', '5'],
|
|
8
|
+
'3xl': ['12', '6'],
|
|
9
|
+
'4xl': ['14', '7'],
|
|
10
|
+
'5xl': ['16', '8'],
|
|
11
|
+
};
|
|
12
|
+
export default function ({ addComponents }) {
|
|
13
|
+
const classes = {};
|
|
14
|
+
Object.keys(padding).forEach((key) => {
|
|
15
|
+
const [x, y] = padding[key];
|
|
16
|
+
classes[`.lum-pad-${key}`] = {
|
|
17
|
+
[`@apply px-${x} py-${y}`]: {},
|
|
18
|
+
};
|
|
19
|
+
classes[`.lum-pad-equal-${key}`] = {
|
|
20
|
+
[`@apply p-${y}`]: {},
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
addComponents(classes);
|
|
24
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import plugin from 'tailwindcss/plugin';
|
|
2
|
+
import { readdirSync } from 'fs';
|
|
3
|
+
export default plugin(function (plugin) {
|
|
4
|
+
const components = readdirSync(__dirname + '/components').map((file) => file.split('.')[0]);
|
|
5
|
+
components.forEach((component) => {
|
|
6
|
+
import(`./components/${component}`).then((module) => module.default(plugin));
|
|
7
|
+
});
|
|
8
|
+
});
|