cladux-html 0.1.0 → 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 (66) hide show
  1. package/README.md +22 -11
  2. package/cl.css +2246 -2
  3. package/cl.js +866 -2
  4. package/cl.min.css +2 -0
  5. package/cl.min.js +2 -0
  6. package/cl.min.mjs +2 -0
  7. package/cl.mjs +868 -0
  8. package/components/accordion.css +103 -0
  9. package/components/accordion.min.css +2 -0
  10. package/components/badge.css +100 -0
  11. package/components/badge.min.css +2 -0
  12. package/components/button.css +178 -0
  13. package/components/button.min.css +2 -0
  14. package/components/card.css +88 -0
  15. package/components/card.min.css +2 -0
  16. package/components/carousel.css +75 -0
  17. package/components/carousel.min.css +2 -0
  18. package/components/checkbox.css +80 -0
  19. package/components/checkbox.min.css +2 -0
  20. package/components/combobox.css +260 -0
  21. package/components/combobox.min.css +2 -0
  22. package/components/dialog.css +128 -0
  23. package/components/dialog.min.css +2 -0
  24. package/components/dropdown-menu.css +178 -0
  25. package/components/dropdown-menu.min.css +2 -0
  26. package/components/input.css +71 -0
  27. package/components/input.min.css +2 -0
  28. package/components/kbd.css +34 -0
  29. package/components/kbd.min.css +2 -0
  30. package/components/label.css +23 -0
  31. package/components/label.min.css +2 -0
  32. package/components/popover.css +94 -0
  33. package/components/popover.min.css +2 -0
  34. package/components/select.css +89 -0
  35. package/components/select.min.css +2 -0
  36. package/components/separator.css +16 -0
  37. package/components/separator.min.css +2 -0
  38. package/components/sheet.css +134 -0
  39. package/components/sheet.min.css +2 -0
  40. package/components/skeleton.css +15 -0
  41. package/components/skeleton.min.css +2 -0
  42. package/components/slider.css +88 -0
  43. package/components/slider.min.css +2 -0
  44. package/components/switch.css +84 -0
  45. package/components/switch.min.css +2 -0
  46. package/components/tabs.css +121 -0
  47. package/components/tabs.min.css +2 -0
  48. package/components/textarea.css +61 -0
  49. package/components/textarea.min.css +2 -0
  50. package/components/toast.css +139 -0
  51. package/components/toast.min.css +2 -0
  52. package/components/tooltip.css +115 -0
  53. package/components/tooltip.min.css +2 -0
  54. package/core.css +178 -0
  55. package/core.min.css +2 -0
  56. package/package.json +35 -4
  57. package/types/accordion.d.ts +1 -0
  58. package/types/carousel.d.ts +8 -0
  59. package/types/combobox.d.ts +11 -0
  60. package/types/dialog.d.ts +3 -0
  61. package/types/floating.d.ts +12 -0
  62. package/types/index.d.ts +16 -0
  63. package/types/position.d.ts +17 -0
  64. package/types/slider.d.ts +5 -0
  65. package/types/tabs.d.ts +4 -0
  66. package/types/toast.d.ts +21 -0
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # cladux-html
2
2
 
3
3
  [Cladux](https://cladux.vercel.app) for plain HTML: accessible components in
4
- shadcn/ui's look, as `cl-*` classes on ordinary HTML. One stylesheet and one
5
- small script, with no React and no build step. Use it on a static page, a CMS,
6
- or a Rails, Django or Laravel view.
4
+ shadcn/ui's look, as `cl-*` classes on ordinary HTML. One stylesheet (or just
5
+ the components you use) and one small script, with no React and no build step.
6
+ Use it on a static page, a CMS, or a Rails, Django or Laravel view.
7
7
 
8
8
  ## From a CDN
9
9
 
10
10
  ```html
11
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cladux-html@0.1.0/cl.css" />
12
- <script src="https://cdn.jsdelivr.net/npm/cladux-html@0.1.0/cl.js" defer></script>
11
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cladux-html@0.3.0/cl.min.css" />
12
+ <script src="https://cdn.jsdelivr.net/npm/cladux-html@0.3.0/cl.min.js" defer></script>
13
13
  ```
14
14
 
15
- unpkg works the same way: `https://unpkg.com/cladux-html@0.1.0/cl.css`.
15
+ unpkg works the same way: `https://unpkg.com/cladux-html@0.3.0/cl.min.css`.
16
16
 
17
17
  Keep the exact version in the link, so an update never changes your site
18
18
  without you knowing. jsDelivr shows a [Subresource Integrity](https://www.jsdelivr.com/package/npm/cladux-html)
@@ -26,15 +26,26 @@ npm install cladux-html
26
26
 
27
27
  ```js
28
28
  import "cladux-html/cl.css";
29
- import "cladux-html/cl.js";
29
+ import { start, toast } from "cladux-html";
30
+
31
+ start();
32
+ toast.success("Changes saved");
30
33
  ```
31
34
 
35
+ `cladux-html` is an ES module with TypeScript types. It starts nothing until
36
+ you call `start()`, and adds no global.
37
+
32
38
  ## What's in it
33
39
 
34
- - `cl.css` (about 34 KB): the theme, a small reset, the components and the
35
- layout helpers.
36
- - `cl.js` (about 10 KB, no dependencies): opens dialogs, positions popovers and
37
- menus, switches tabs and shows toasts. Pages without those don't need it.
40
+ - `cl.min.css` (about 8 KB gzipped): the theme, a small reset, the components
41
+ and the layout helpers.
42
+ - `cl.min.js` (about 7 KB gzipped, no dependencies): opens dialogs and sheets,
43
+ positions popovers and menus, switches tabs, filters comboboxes, moves
44
+ carousels and shows toasts. Pages without those don't need it.
45
+ - `core.min.css` and `components/<name>.min.css`: the same CSS split up, so a
46
+ page can load the theme and only the components it uses.
47
+ - `cl.min.mjs`: the script as an ES module, with types in `types/`.
48
+ - Readable versions of each, without `.min`, for looking inside or debugging.
38
49
 
39
50
  ```html
40
51
  <button class="cl-button" data-variant="outline">Cancel</button>