@studiocms/ui 0.0.1 → 0.3.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.
Files changed (37) hide show
  1. package/README.md +28 -544
  2. package/package.json +11 -6
  3. package/src/components/Button.astro +303 -269
  4. package/src/components/Card.astro +37 -13
  5. package/src/components/Center.astro +2 -2
  6. package/src/components/Checkbox.astro +99 -29
  7. package/src/components/Divider.astro +15 -8
  8. package/src/components/Dropdown/Dropdown.astro +102 -41
  9. package/src/components/Dropdown/dropdown.ts +111 -23
  10. package/src/components/Footer.astro +137 -0
  11. package/src/components/Input.astro +42 -14
  12. package/src/components/Modal/Modal.astro +84 -30
  13. package/src/components/Modal/modal.ts +43 -9
  14. package/src/components/RadioGroup.astro +153 -29
  15. package/src/components/Row.astro +16 -7
  16. package/src/components/SearchSelect.astro +278 -222
  17. package/src/components/Select.astro +260 -127
  18. package/src/components/Sidebar/Double.astro +12 -12
  19. package/src/components/Sidebar/Single.astro +6 -6
  20. package/src/components/Sidebar/helpers.ts +53 -7
  21. package/src/components/Tabs/TabItem.astro +47 -0
  22. package/src/components/Tabs/Tabs.astro +376 -0
  23. package/src/components/Tabs/index.ts +2 -0
  24. package/src/components/Textarea.astro +56 -15
  25. package/src/components/ThemeToggle.astro +14 -8
  26. package/src/components/Toast/Toaster.astro +171 -31
  27. package/src/components/Toggle.astro +89 -21
  28. package/src/components/User.astro +34 -15
  29. package/src/components/index.ts +24 -22
  30. package/src/components.ts +2 -0
  31. package/src/css/colors.css +65 -65
  32. package/src/css/resets.css +0 -1
  33. package/src/integration.ts +18 -0
  34. package/src/layouts/RootLayout.astro +1 -2
  35. package/src/types/index.ts +1 -1
  36. package/src/utils/ThemeHelper.ts +135 -117
  37. package/src/utils/create-resolver.ts +30 -0
@@ -0,0 +1,30 @@
1
+ import { dirname, resolve } from 'node:path'; // Swapped out pathe for node:path to cut down on dependencies
2
+ import { fileURLToPath } from 'node:url';
3
+
4
+ /**
5
+ * From the Astro Integration Kit (https://astro-integration-kit.netlify.app/).
6
+ *
7
+ * Allows resolving paths relatively to the integration folder easily. Call it like this:
8
+ *
9
+ * @param {string} _base - The location you want to create relative references from. `import.meta.url` is usually what you'll want.
10
+ *
11
+ * @see https://astro-integration-kit.netlify.app/core/create-resolver/
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const { resolve } = createResolver(import.meta.url);
16
+ * const pluginPath = resolve("./plugin.ts");
17
+ * ```
18
+ *
19
+ * This way, you do not have to add your plugin to your package.json `exports`.
20
+ */
21
+ export const createResolver = (_base: string) => {
22
+ let base = _base;
23
+ if (base.startsWith('file://')) {
24
+ base = dirname(fileURLToPath(base));
25
+ }
26
+
27
+ return {
28
+ resolve: (...path: Array<string>) => resolve(base, ...path),
29
+ };
30
+ };