@holmdigital/components 1.1.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 (43) hide show
  1. package/README.md +46 -0
  2. package/dist/Button/Button.js +117 -0
  3. package/dist/Button/Button.mjs +6 -0
  4. package/dist/Checkbox/Checkbox.js +82 -0
  5. package/dist/Checkbox/Checkbox.mjs +6 -0
  6. package/dist/Dialog/Dialog.js +129 -0
  7. package/dist/Dialog/Dialog.mjs +6 -0
  8. package/dist/FormField/FormField.js +110 -0
  9. package/dist/FormField/FormField.mjs +6 -0
  10. package/dist/Heading/Heading.js +48 -0
  11. package/dist/Heading/Heading.mjs +6 -0
  12. package/dist/Modal/Modal.js +146 -0
  13. package/dist/Modal/Modal.mjs +7 -0
  14. package/dist/NavigationMenu/NavigationMenu.js +141 -0
  15. package/dist/NavigationMenu/NavigationMenu.mjs +6 -0
  16. package/dist/RadioGroup/RadioGroup.js +103 -0
  17. package/dist/RadioGroup/RadioGroup.mjs +6 -0
  18. package/dist/Select/Select.js +157 -0
  19. package/dist/Select/Select.mjs +12 -0
  20. package/dist/SkipLink/SkipLink.js +59 -0
  21. package/dist/SkipLink/SkipLink.mjs +6 -0
  22. package/dist/Switch/Switch.js +82 -0
  23. package/dist/Switch/Switch.mjs +6 -0
  24. package/dist/Toast/Toast.js +123 -0
  25. package/dist/Toast/Toast.mjs +8 -0
  26. package/dist/Tooltip/Tooltip.js +121 -0
  27. package/dist/Tooltip/Tooltip.mjs +12 -0
  28. package/dist/chunk-2MJRKHPL.mjs +98 -0
  29. package/dist/chunk-5RKBS475.mjs +58 -0
  30. package/dist/chunk-C5M6C7KT.mjs +84 -0
  31. package/dist/chunk-GK4BYT56.mjs +117 -0
  32. package/dist/chunk-HALLFO25.mjs +22 -0
  33. package/dist/chunk-LZ42XDDI.mjs +105 -0
  34. package/dist/chunk-MKKQLWGK.mjs +35 -0
  35. package/dist/chunk-NDYRGXQ6.mjs +93 -0
  36. package/dist/chunk-NOE5QKC2.mjs +58 -0
  37. package/dist/chunk-PLT5CAFO.mjs +86 -0
  38. package/dist/chunk-V2JYAFB7.mjs +130 -0
  39. package/dist/chunk-W4ZHBRFT.mjs +14 -0
  40. package/dist/chunk-YMSNGQN6.mjs +79 -0
  41. package/dist/index.js +1256 -0
  42. package/dist/index.mjs +308 -0
  43. package/package.json +113 -0
@@ -0,0 +1,79 @@
1
+ // src/RadioGroup/RadioGroup.tsx
2
+ import { forwardRef } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var RadioGroup = forwardRef(
5
+ ({ name, options, value, onChange, orientation = "vertical", className = "", label }, ref) => {
6
+ return /* @__PURE__ */ jsxs(
7
+ "div",
8
+ {
9
+ ref,
10
+ className: `${className}`,
11
+ role: "radiogroup",
12
+ "aria-labelledby": label ? `${name}-label` : void 0,
13
+ children: [
14
+ label && /* @__PURE__ */ jsx("div", { id: `${name}-label`, className: "text-sm font-medium text-slate-900 mb-2", children: label }),
15
+ /* @__PURE__ */ jsx("div", { className: `flex ${orientation === "vertical" ? "flex-col space-y-3" : "flex-row space-x-6"}`, children: options.map((option) => {
16
+ const optionId = `${name}-${option.value}`;
17
+ const isChecked = value === option.value;
18
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
19
+ /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center", children: [
20
+ /* @__PURE__ */ jsx(
21
+ "input",
22
+ {
23
+ id: optionId,
24
+ name,
25
+ type: "radio",
26
+ value: option.value,
27
+ checked: isChecked,
28
+ disabled: option.disabled,
29
+ onChange: (e) => {
30
+ if (e.target.checked) {
31
+ onChange?.(option.value);
32
+ }
33
+ },
34
+ className: "peer sr-only"
35
+ }
36
+ ),
37
+ /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ className: `
41
+ h-5 w-5 rounded-full border border-slate-300 bg-white shadow-sm transition-all
42
+ peer-focus:ring-2 peer-focus:ring-primary-500 peer-focus:ring-offset-2
43
+ peer-checked:border-primary-600 peer-checked:bg-white
44
+ peer-disabled:cursor-not-allowed peer-disabled:opacity-50
45
+ hover:border-primary-400
46
+ `,
47
+ "aria-hidden": "true"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ className: `
54
+ absolute h-2.5 w-2.5 rounded-full bg-primary-600 transition-transform duration-200 scale-0
55
+ ${isChecked ? "scale-100" : ""}
56
+ `
57
+ }
58
+ )
59
+ ] }),
60
+ /* @__PURE__ */ jsx(
61
+ "label",
62
+ {
63
+ htmlFor: optionId,
64
+ className: `ml-3 text-sm font-medium ${option.disabled ? "text-slate-400" : "text-slate-700"} cursor-pointer select-none`,
65
+ children: option.label
66
+ }
67
+ )
68
+ ] }, option.value);
69
+ }) })
70
+ ]
71
+ }
72
+ );
73
+ }
74
+ );
75
+ RadioGroup.displayName = "RadioGroup";
76
+
77
+ export {
78
+ RadioGroup
79
+ };