@luminescent/ui 0.19.2 → 1.0.5

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.
Files changed (61) hide show
  1. package/package.json +16 -33
  2. package/src/components/bg.ts +38 -0
  3. package/src/components/btn.ts +9 -0
  4. package/src/components/card.ts +9 -0
  5. package/src/components/input.ts +9 -0
  6. package/src/components/loading.ts +9 -0
  7. package/src/components/pad.ts +60 -0
  8. package/src/index.ts +9 -0
  9. package/lib/index.qwik.cjs +0 -2730
  10. package/lib/index.qwik.mjs +0 -2730
  11. package/lib-types/components/docs/Anchor.d.ts +0 -2
  12. package/lib-types/components/docs/Blobs.d.ts +0 -2
  13. package/lib-types/components/docs/Button.d.ts +0 -2
  14. package/lib-types/components/docs/Card.d.ts +0 -2
  15. package/lib-types/components/docs/ColorInput.d.ts +0 -2
  16. package/lib-types/components/docs/ColorPicker.d.ts +0 -2
  17. package/lib-types/components/docs/Dropdown.d.ts +0 -2
  18. package/lib-types/components/docs/IconsLogos.d.ts +0 -2
  19. package/lib-types/components/docs/Nav.d.ts +0 -2
  20. package/lib-types/components/docs/NumberInput.d.ts +0 -2
  21. package/lib-types/components/docs/TextArea.d.ts +0 -2
  22. package/lib-types/components/docs/TextInput.d.ts +0 -2
  23. package/lib-types/components/docs/Toggle.d.ts +0 -2
  24. package/lib-types/components/elements/Anchor.d.ts +0 -5
  25. package/lib-types/components/elements/Blobs.d.ts +0 -36
  26. package/lib-types/components/elements/Button.d.ts +0 -182
  27. package/lib-types/components/elements/Card.d.ts +0 -159
  28. package/lib-types/components/elements/ColorInput.d.ts +0 -12
  29. package/lib-types/components/elements/ColorPicker.d.ts +0 -15
  30. package/lib-types/components/elements/Dropdown.d.ts +0 -22
  31. package/lib-types/components/elements/Header.d.ts +0 -12
  32. package/lib-types/components/elements/LoadingIcon.d.ts +0 -10
  33. package/lib-types/components/elements/Nav.d.ts +0 -38
  34. package/lib-types/components/elements/NumberInput.d.ts +0 -23
  35. package/lib-types/components/elements/TextArea.d.ts +0 -15
  36. package/lib-types/components/elements/TextInput.d.ts +0 -43
  37. package/lib-types/components/elements/Toggle.d.ts +0 -212
  38. package/lib-types/components/elements.d.ts +0 -13
  39. package/lib-types/components/logos/Birdflop.d.ts +0 -7
  40. package/lib-types/components/logos/Discord.d.ts +0 -2
  41. package/lib-types/components/logos/Fabric.d.ts +0 -2
  42. package/lib-types/components/logos/Forge.d.ts +0 -2
  43. package/lib-types/components/logos/IconProps.d.ts +0 -3
  44. package/lib-types/components/logos/Luminescent.d.ts +0 -3
  45. package/lib-types/components/logos/Paper.d.ts +0 -2
  46. package/lib-types/components/logos/Pterodactyl.d.ts +0 -2
  47. package/lib-types/components/logos/Purpur.d.ts +0 -2
  48. package/lib-types/components/logos/Velocity.d.ts +0 -2
  49. package/lib-types/components/logos/Waterfall.d.ts +0 -2
  50. package/lib-types/components/logos.d.ts +0 -10
  51. package/lib-types/entry.dev.d.ts +0 -2
  52. package/lib-types/entry.ssr.d.ts +0 -14
  53. package/lib-types/index.d.ts +0 -2
  54. package/lib-types/root.d.ts +0 -3
  55. package/lib-types/svg/ChevronDown.d.ts +0 -2
  56. package/lib-types/svg/Link.d.ts +0 -2
  57. package/lib-types/svg/Minus.d.ts +0 -2
  58. package/lib-types/svg/Plus.d.ts +0 -2
  59. package/lib-types/svg/Shuffle.d.ts +0 -2
  60. package/lib-types/utils/color.d.ts +0 -36
  61. package/src/tailwind.config.js +0 -86
package/package.json CHANGED
@@ -1,22 +1,19 @@
1
1
  {
2
2
  "name": "@luminescent/ui",
3
- "version": "0.19.2",
3
+ "version": "1.0.5",
4
4
  "description": "Luminescent UI library",
5
- "main": "./lib/index.qwik.mjs",
6
- "qwik": "./lib/index.qwik.mjs",
5
+ "main": "./lib/index.js",
6
+ "qwik": "./lib/index.js",
7
7
  "types": "./lib-types/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./lib/index.qwik.mjs",
11
- "require": "./lib/index.qwik.cjs",
10
+ "import": "./lib/index.js",
11
+ "require": "./lib/index.js",
12
12
  "types": "./lib-types/index.d.ts"
13
- },
14
- "./config": "./src/tailwind.config.js"
13
+ }
15
14
  },
16
15
  "files": [
17
- "lib",
18
- "lib-types",
19
- "src/tailwind.config.js"
16
+ "src"
20
17
  ],
21
18
  "engines": {
22
19
  "node": ">=15.0.0"
@@ -28,35 +25,21 @@
28
25
  "access": "public"
29
26
  },
30
27
  "scripts": {
31
- "build": "qwik build",
32
- "build.lib": "vite build --mode lib",
33
- "build.types": "tsc --emitDeclarationOnly",
34
- "dev": "vite --mode ssr",
35
- "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
28
+ "build": "tsc",
29
+ "dev": "echo \"No dev script specified\" && exit 0",
36
30
  "lint": "eslint \"src/**/*.ts*\"",
37
31
  "release": "np",
38
- "start": "vite --open --mode ssr",
39
- "test": "echo \"No test specified\" && exit 0",
40
- "qwik": "qwik"
32
+ "test": "echo \"No test specified\" && exit 0"
41
33
  },
42
34
  "devDependencies": {
43
- "@anuragroy/tailwindcss-animate": "^1.0.6",
44
- "@builder.io/qwik": "1.5.6",
45
- "@builder.io/qwik-city": "^1.5.6",
46
35
  "@types/eslint": "^8.56.10",
47
- "@types/node": "^20.14.2",
48
- "@typescript-eslint/eslint-plugin": "^7.13.0",
49
- "@typescript-eslint/parser": "^7.13.0",
50
- "autoprefixer": "^10.4.19",
51
- "chart.js": "^4.4.3",
36
+ "@types/node": "^20.14.9",
37
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
38
+ "@typescript-eslint/parser": "^7.14.1",
52
39
  "eslint": "^8.57.0",
53
- "eslint-plugin-qwik": "latest",
54
- "np": "^10.0.5",
40
+ "fs": "0.0.1-security",
41
+ "np": "^10.0.6",
55
42
  "postcss": "^8.4.38",
56
- "tailwindcss": "3.4.4",
57
- "typescript": "5.4.5",
58
- "undici": "*",
59
- "vite": "^5.2.13",
60
- "vite-tsconfig-paths": "^4.3.2"
43
+ "tailwindcss": "3.4.4"
61
44
  }
62
45
  }
@@ -0,0 +1,38 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ matchUtilities, theme }: PluginAPI) {
4
+ const colors: { [key: string]: string } = {};
5
+ Object.entries(theme('colors')!).forEach(([color, value]) => {
6
+ if (typeof value == 'string') {
7
+ colors[color] = color;
8
+ }
9
+ else {
10
+ Object.keys(value).forEach((shade) => {
11
+ colors[`${color}-${shade}`] = `${color}.${shade}`;
12
+ });
13
+ }
14
+ });
15
+ matchUtilities({
16
+ 'lum-bg': (value) => {
17
+ const color = value.split('.')[0];
18
+ const shades = Object.values(colors).filter((c) => {
19
+ return c.startsWith(color);
20
+ });
21
+ const index = shades.indexOf(value);
22
+ const borderColor = shades[index - 1 < 0 ? shades.length - 1 : index - 1] || shades[index + 1 > shades.length - 1 ? 0 : index + 1];
23
+ const textColor = shades[index - 5 < 0 ? shades.length - 1 : index - 5] || shades[index + 5 > shades.length - 1 ? 0 : index + 5];
24
+
25
+ return {
26
+ background: theme(`colors.${value}`) ?? value,
27
+ color: theme(`colors.${textColor}`) ?? 'inherit',
28
+ border: `1px solid ${theme(`colors.${borderColor ?? value}`) ?? borderColor ?? value}`,
29
+ outline: 'none',
30
+ '&:focus': {
31
+ border: `1px solid ${theme(`colors.${textColor}`) ?? 'inherit'}`,
32
+ },
33
+ };
34
+ },
35
+ }, {
36
+ values: colors,
37
+ });
38
+ }
@@ -0,0 +1,9 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ addComponents }: PluginAPI) {
4
+ addComponents({
5
+ '.lum-btn': {
6
+ '@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': {},
7
+ },
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ addComponents }: PluginAPI) {
4
+ addComponents({
5
+ '.lum-card': {
6
+ '@apply flex flex-col gap-3 motion-safe:transition ease-in-out whitespace-nowrap': {},
7
+ },
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ addComponents }: PluginAPI) {
4
+ addComponents({
5
+ '.lum-input': {
6
+ '@apply flex motion-safe:transition ease-in-out disabled:opacity-50 hover:drop-shadow-lg whitespace-nowrap touch-manipulation select-none': {},
7
+ },
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ addComponents }: PluginAPI) {
4
+ addComponents({
5
+ '.lum-loading': {
6
+ '@apply animate-spin rounded-full border-transparent border-l-current border-t-current border-4': {},
7
+ },
8
+ });
9
+ }
@@ -0,0 +1,60 @@
1
+ import type { PluginAPI } from 'tailwindcss/types/config';
2
+
3
+ export default function ({ addComponents }: PluginAPI) {
4
+ addComponents({
5
+ '.lum-pad-xs': {
6
+ '@apply px-2.5 py-1.5': {},
7
+ '&.lum-pad-equal': {
8
+ '@apply p-1.5': {},
9
+ },
10
+ },
11
+ '.lum-pad-sm': {
12
+ '@apply px-3 py-2': {},
13
+ '&.lum-pad-equal': {
14
+ '@apply p-2': {},
15
+ },
16
+ },
17
+ '.lum-pad-md': {
18
+ '@apply px-4 py-2': {},
19
+ '&.lum-pad-equal': {
20
+ '@apply p-2': {},
21
+ },
22
+ },
23
+ '.lum-pad-lg': {
24
+ '@apply px-7 py-4': {},
25
+ '&.lum-pad-equal': {
26
+ '@apply p-4': {},
27
+ },
28
+ },
29
+ '.lum-pad-xl': {
30
+ '@apply px-8 py-4': {},
31
+ '&.lum-pad-equal': {
32
+ '@apply p-4': {},
33
+ },
34
+ },
35
+ '.lum-pad-2xl': {
36
+ '@apply px-10 py-5': {},
37
+ '&.lum-pad-equal': {
38
+ '@apply p-5': {},
39
+ },
40
+ },
41
+ '.lum-pad-3xl': {
42
+ '@apply px-12 py-6': {},
43
+ '&.lum-pad-equal': {
44
+ '@apply p-6': {},
45
+ },
46
+ },
47
+ '.lum-pad-4xl': {
48
+ '@apply px-14 py-7': {},
49
+ '&.lum-pad-equal': {
50
+ '@apply p-7': {},
51
+ },
52
+ },
53
+ '.lum-pad-5xl': {
54
+ '@apply px-16 py-8': {},
55
+ '&.lum-pad-equal': {
56
+ '@apply p-8': {},
57
+ },
58
+ },
59
+ });
60
+ }
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ import plugin from 'tailwindcss/plugin';
2
+ import { readdirSync } from 'fs';
3
+
4
+ export default plugin(function (plugin) {
5
+ const components = readdirSync(__dirname + '/components').map((file: string) => file.split('.')[0]) as string[];
6
+ components.forEach((component) => {
7
+ import(`./components/${component}`).then((module) => module.default(plugin));
8
+ });
9
+ });