@jiwambe/components 0.2.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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +367 -0
  3. package/dist/client.d.ts +40 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +46 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/components/Accordion/Accordion.d.ts +74 -0
  8. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  9. package/dist/components/Accordion/Accordion.js +297 -0
  10. package/dist/components/Accordion/Accordion.js.map +1 -0
  11. package/dist/components/Box/Box.d.ts +56 -0
  12. package/dist/components/Box/Box.d.ts.map +1 -0
  13. package/dist/components/Box/Box.js +51 -0
  14. package/dist/components/Box/Box.js.map +1 -0
  15. package/dist/components/Breadcrumb/Breadcrumb.d.ts +66 -0
  16. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  17. package/dist/components/Button/Button.d.ts +54 -0
  18. package/dist/components/Button/Button.d.ts.map +1 -0
  19. package/dist/components/Button/Button.js +92 -0
  20. package/dist/components/Button/Button.js.map +1 -0
  21. package/dist/components/Card/Card.d.ts +54 -0
  22. package/dist/components/Card/Card.d.ts.map +1 -0
  23. package/dist/components/Card/Card.js +98 -0
  24. package/dist/components/Card/Card.js.map +1 -0
  25. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +61 -0
  26. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
  27. package/dist/components/CheckboxGroup/CheckboxGroup.js +205 -0
  28. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
  29. package/dist/components/Container/Container.d.ts +72 -0
  30. package/dist/components/Container/Container.d.ts.map +1 -0
  31. package/dist/components/Container/Container.js +69 -0
  32. package/dist/components/Container/Container.js.map +1 -0
  33. package/dist/components/DateInput/DateInput.d.ts +61 -0
  34. package/dist/components/DateInput/DateInput.d.ts.map +1 -0
  35. package/dist/components/DateInput/DateInput.js +234 -0
  36. package/dist/components/DateInput/DateInput.js.map +1 -0
  37. package/dist/components/Divider/Divider.d.ts +44 -0
  38. package/dist/components/Divider/Divider.d.ts.map +1 -0
  39. package/dist/components/Divider/Divider.js +35 -0
  40. package/dist/components/Divider/Divider.js.map +1 -0
  41. package/dist/components/Drawer/Drawer.d.ts +35 -0
  42. package/dist/components/Drawer/Drawer.d.ts.map +1 -0
  43. package/dist/components/Drawer/Drawer.js +37 -0
  44. package/dist/components/Drawer/Drawer.js.map +1 -0
  45. package/dist/components/FAQ/FAQ.d.ts +40 -0
  46. package/dist/components/FAQ/FAQ.d.ts.map +1 -0
  47. package/dist/components/FAQ/FAQ.js +161 -0
  48. package/dist/components/FAQ/FAQ.js.map +1 -0
  49. package/dist/components/Grid/Grid.d.ts +61 -0
  50. package/dist/components/Grid/Grid.d.ts.map +1 -0
  51. package/dist/components/Grid/Grid.js +95 -0
  52. package/dist/components/Grid/Grid.js.map +1 -0
  53. package/dist/components/Icon/Icon.d.ts +21 -0
  54. package/dist/components/Icon/Icon.d.ts.map +1 -0
  55. package/dist/components/Icon/Icon.js +167 -0
  56. package/dist/components/Icon/Icon.js.map +1 -0
  57. package/dist/components/Link/Link.d.ts +49 -0
  58. package/dist/components/Link/Link.d.ts.map +1 -0
  59. package/dist/components/Link/Link.js +70 -0
  60. package/dist/components/Link/Link.js.map +1 -0
  61. package/dist/components/List/List.d.ts +36 -0
  62. package/dist/components/List/List.d.ts.map +1 -0
  63. package/dist/components/List/List.js +42 -0
  64. package/dist/components/List/List.js.map +1 -0
  65. package/dist/components/List/index.d.ts +3 -0
  66. package/dist/components/List/index.d.ts.map +1 -0
  67. package/dist/components/Overlay/Overlay.d.ts +35 -0
  68. package/dist/components/Overlay/Overlay.d.ts.map +1 -0
  69. package/dist/components/Overlay/Overlay.js +51 -0
  70. package/dist/components/Overlay/Overlay.js.map +1 -0
  71. package/dist/components/PhoneInput/PhoneInput.d.ts +55 -0
  72. package/dist/components/PhoneInput/PhoneInput.d.ts.map +1 -0
  73. package/dist/components/PhoneInput/PhoneInput.js +255 -0
  74. package/dist/components/PhoneInput/PhoneInput.js.map +1 -0
  75. package/dist/components/Popover/Popover.d.ts +46 -0
  76. package/dist/components/Popover/Popover.d.ts.map +1 -0
  77. package/dist/components/Popover/Popover.js +57 -0
  78. package/dist/components/Popover/Popover.js.map +1 -0
  79. package/dist/components/ProductImage/ProductImage.d.ts +78 -0
  80. package/dist/components/ProductImage/ProductImage.d.ts.map +1 -0
  81. package/dist/components/ProductImage/ProductImage.js +220 -0
  82. package/dist/components/ProductImage/ProductImage.js.map +1 -0
  83. package/dist/components/RadioGroup/RadioGroup.d.ts +63 -0
  84. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
  85. package/dist/components/RadioGroup/RadioGroup.js +233 -0
  86. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  87. package/dist/components/Section/Section.d.ts +44 -0
  88. package/dist/components/Section/Section.d.ts.map +1 -0
  89. package/dist/components/Section/Section.js +48 -0
  90. package/dist/components/Section/Section.js.map +1 -0
  91. package/dist/components/Select/Select.d.ts +47 -0
  92. package/dist/components/Select/Select.d.ts.map +1 -0
  93. package/dist/components/Select/Select.js +153 -0
  94. package/dist/components/Select/Select.js.map +1 -0
  95. package/dist/components/SelectTab/SelectTab.d.ts +62 -0
  96. package/dist/components/SelectTab/SelectTab.d.ts.map +1 -0
  97. package/dist/components/SelectTab/SelectTab.js +192 -0
  98. package/dist/components/SelectTab/SelectTab.js.map +1 -0
  99. package/dist/components/Skeleton/Skeleton.d.ts +87 -0
  100. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
  101. package/dist/components/Skeleton/Skeleton.js +97 -0
  102. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  103. package/dist/components/Skeleton/index.d.ts +3 -0
  104. package/dist/components/Skeleton/index.d.ts.map +1 -0
  105. package/dist/components/Slider/Slider.d.ts +47 -0
  106. package/dist/components/Slider/Slider.d.ts.map +1 -0
  107. package/dist/components/Slider/Slider.js +147 -0
  108. package/dist/components/Slider/Slider.js.map +1 -0
  109. package/dist/components/Stack/Stack.d.ts +145 -0
  110. package/dist/components/Stack/Stack.d.ts.map +1 -0
  111. package/dist/components/Stack/Stack.js +80 -0
  112. package/dist/components/Stack/Stack.js.map +1 -0
  113. package/dist/components/Tab/Tab.d.ts +38 -0
  114. package/dist/components/Tab/Tab.d.ts.map +1 -0
  115. package/dist/components/Tab/Tab.js +146 -0
  116. package/dist/components/Tab/Tab.js.map +1 -0
  117. package/dist/components/TextArea/TextArea.d.ts +32 -0
  118. package/dist/components/TextArea/TextArea.d.ts.map +1 -0
  119. package/dist/components/TextArea/TextArea.js +118 -0
  120. package/dist/components/TextArea/TextArea.js.map +1 -0
  121. package/dist/components/TextInput/TextInput.d.ts +35 -0
  122. package/dist/components/TextInput/TextInput.d.ts.map +1 -0
  123. package/dist/components/TextInput/TextInput.js +128 -0
  124. package/dist/components/TextInput/TextInput.js.map +1 -0
  125. package/dist/components/Toggle/Toggle.d.ts +83 -0
  126. package/dist/components/Toggle/Toggle.d.ts.map +1 -0
  127. package/dist/components/Toggle/Toggle.js +121 -0
  128. package/dist/components/Toggle/Toggle.js.map +1 -0
  129. package/dist/components/Typography/Typography.d.ts +321 -0
  130. package/dist/components/Typography/Typography.d.ts.map +1 -0
  131. package/dist/components/Typography/Typography.js +21 -0
  132. package/dist/components/Typography/Typography.js.map +1 -0
  133. package/dist/components/UploadInput/UploadInput.d.ts +39 -0
  134. package/dist/components/UploadInput/UploadInput.d.ts.map +1 -0
  135. package/dist/components/UploadInput/UploadInput.js +297 -0
  136. package/dist/components/UploadInput/UploadInput.js.map +1 -0
  137. package/dist/components/index.d.ts +65 -0
  138. package/dist/components/index.d.ts.map +1 -0
  139. package/dist/index.d.ts +7 -0
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +69 -0
  142. package/dist/index.js.map +1 -0
  143. package/dist/plugin/jiwambe-plugin.d.ts +37 -0
  144. package/dist/plugin/jiwambe-plugin.d.ts.map +1 -0
  145. package/dist/plugin/jiwambe-plugin.js +640 -0
  146. package/dist/plugin/jiwambe-plugin.js.map +1 -0
  147. package/dist/server.d.ts +22 -0
  148. package/dist/server.d.ts.map +1 -0
  149. package/dist/server.js +23 -0
  150. package/dist/server.js.map +1 -0
  151. package/dist/types/index.d.ts +103 -0
  152. package/dist/types/index.d.ts.map +1 -0
  153. package/dist/types/layout.d.ts +138 -0
  154. package/dist/types/layout.d.ts.map +1 -0
  155. package/dist/types/list.d.ts +69 -0
  156. package/dist/types/list.d.ts.map +1 -0
  157. package/dist/types/list.js +9 -0
  158. package/dist/types/list.js.map +1 -0
  159. package/dist/types/skeleton.d.ts +38 -0
  160. package/dist/types/skeleton.d.ts.map +1 -0
  161. package/dist/types/skeleton.js +13 -0
  162. package/dist/types/skeleton.js.map +1 -0
  163. package/dist/types/spacing.d.ts +105 -0
  164. package/dist/types/spacing.d.ts.map +1 -0
  165. package/dist/utils/layoutClasses.d.ts +44 -0
  166. package/dist/utils/layoutClasses.d.ts.map +1 -0
  167. package/dist/utils/layoutClasses.js +88 -0
  168. package/dist/utils/layoutClasses.js.map +1 -0
  169. package/dist/utils/responsive-props.d.ts +60 -0
  170. package/dist/utils/responsive-props.d.ts.map +1 -0
  171. package/dist/utils/responsive-props.js +184 -0
  172. package/dist/utils/responsive-props.js.map +1 -0
  173. package/dist/utils/spacing.d.ts +52 -0
  174. package/dist/utils/spacing.d.ts.map +1 -0
  175. package/dist/utils/spacing.js +625 -0
  176. package/dist/utils/spacing.js.map +1 -0
  177. package/package.json +96 -0
  178. package/tailwind.preset.d.ts +3 -0
  179. package/tailwind.preset.ts +21 -0
@@ -0,0 +1,297 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { useId, useRef, useState } from "react";
4
+ function UploadIcon({ className }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "svg",
7
+ {
8
+ className,
9
+ width: "24",
10
+ height: "24",
11
+ viewBox: "0 0 24 24",
12
+ fill: "none",
13
+ stroke: "currentColor",
14
+ strokeWidth: "1.25",
15
+ strokeLinecap: "round",
16
+ strokeLinejoin: "round",
17
+ "aria-hidden": "true",
18
+ children: /* @__PURE__ */ jsx("path", { d: "M21 15V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V15M17 8L12 3M12 3L7 8M12 3V15" })
19
+ }
20
+ );
21
+ }
22
+ function FileIcon({ className, disabled }) {
23
+ return /* @__PURE__ */ jsx(
24
+ "svg",
25
+ {
26
+ className,
27
+ width: "20",
28
+ height: "20",
29
+ viewBox: "0 0 20 20",
30
+ fill: "none",
31
+ stroke: "currentColor",
32
+ strokeWidth: "1.5",
33
+ strokeLinecap: "round",
34
+ strokeLinejoin: "round",
35
+ "aria-hidden": "true",
36
+ children: /* @__PURE__ */ jsx(
37
+ "path",
38
+ {
39
+ d: "M11.6668 1.89136V5.33348C11.6668 5.80018 11.6668 6.03354 11.7577 6.2118C11.8376 6.3686 11.965 6.49608 12.1218 6.57598C12.3001 6.66681 12.5335 6.66681 13.0002 6.66681H16.4423M11.6668 14.1667H6.66683M13.3335 10.8334H6.66683M16.6668 8.3236V14.3334C16.6668 15.7335 16.6668 16.4336 16.3943 16.9684C16.1547 17.4388 15.7722 17.8212 15.3018 18.0609C14.767 18.3334 14.067 18.3334 12.6668 18.3334H7.3335C5.93336 18.3334 5.2333 18.3334 4.69852 18.0609C4.22811 17.8212 3.84566 17.4388 3.60598 16.9684C3.3335 16.4336 3.3335 15.7335 3.3335 14.3334V5.66675C3.3335 4.26662 3.3335 3.56655 3.60598 3.03177C3.84566 2.56137 4.22811 2.17892 4.69852 1.93923C5.2333 1.66675 5.93336 1.66675 7.3335 1.66675H10.01C10.6215 1.66675 10.9272 1.66675 11.2149 1.73582C11.47 1.79707 11.7139 1.89808 11.9375 2.03515C12.1898 2.18975 12.406 2.40594 12.8384 2.83832L15.4953 5.49517C15.9276 5.92755 16.1438 6.14374 16.2984 6.39604C16.4355 6.61972 16.5365 6.86358 16.5978 7.11867C16.6668 7.40639 16.6668 7.71213 16.6668 8.3236Z",
40
+ strokeOpacity: disabled ? 0.5 : void 0
41
+ }
42
+ )
43
+ }
44
+ );
45
+ }
46
+ function FileIconDisabled({ className }) {
47
+ return /* @__PURE__ */ jsx(
48
+ "svg",
49
+ {
50
+ className,
51
+ width: "14",
52
+ height: "17",
53
+ viewBox: "0 0 15 19",
54
+ fill: "none",
55
+ stroke: "currentColor",
56
+ strokeWidth: "1.5",
57
+ strokeLinecap: "round",
58
+ strokeLinejoin: "round",
59
+ "aria-hidden": "true",
60
+ children: /* @__PURE__ */ jsx(
61
+ "path",
62
+ {
63
+ d: "M9.08333 0.974609V4.41673C9.08333 4.88344 9.08333 5.11679 9.17416 5.29505C9.25406 5.45185 9.38154 5.57934 9.53834 5.65923C9.7166 5.75006 9.94996 5.75006 10.4167 5.75006H13.8588M9.08333 13.25H4.08333M10.75 9.91667H4.08333M14.0833 7.40685V13.4167C14.0833 14.8168 14.0833 15.5169 13.8108 16.0516C13.5712 16.522 13.1887 16.9045 12.7183 17.1442C12.1835 17.4167 11.4835 17.4167 10.0833 17.4167H4.75C3.34987 17.4167 2.6498 17.4167 2.11502 17.1442C1.64462 16.9045 1.26217 16.522 1.02248 16.0516C0.75 15.5169 0.75 14.8168 0.75 13.4167V4.75C0.75 3.34987 0.75 2.6498 1.02248 2.11502C1.26217 1.64462 1.64462 1.26217 2.11502 1.02248C2.6498 0.75 3.34987 0.75 4.75 0.75H7.42648C8.03796 0.75 8.34369 0.75 8.63141 0.819075C8.8865 0.880317 9.13036 0.981328 9.35405 1.1184C9.60634 1.273 9.82253 1.48919 10.2549 1.92157L12.9118 4.57843C13.3441 5.01081 13.5603 5.227 13.7149 5.47929C13.852 5.70297 13.953 5.94683 14.0143 6.20192C14.0833 6.48964 14.0833 6.79538 14.0833 7.40685Z",
64
+ strokeOpacity: 0.5
65
+ }
66
+ )
67
+ }
68
+ );
69
+ }
70
+ function CloseIcon({ className }) {
71
+ return /* @__PURE__ */ jsx(
72
+ "svg",
73
+ {
74
+ className,
75
+ width: "24",
76
+ height: "24",
77
+ viewBox: "0 0 24 24",
78
+ fill: "none",
79
+ stroke: "currentColor",
80
+ strokeWidth: "1.25",
81
+ strokeLinecap: "round",
82
+ strokeLinejoin: "round",
83
+ "aria-hidden": "true",
84
+ children: /* @__PURE__ */ jsx("path", { d: "M17 7L7 17M7 7L17 17" })
85
+ }
86
+ );
87
+ }
88
+ function ErrorIcon({ className }) {
89
+ return /* @__PURE__ */ jsx(
90
+ "svg",
91
+ {
92
+ className,
93
+ viewBox: "0 0 20 20",
94
+ fill: "currentColor",
95
+ "aria-hidden": "true",
96
+ children: /* @__PURE__ */ jsx(
97
+ "path",
98
+ {
99
+ fillRule: "evenodd",
100
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
101
+ clipRule: "evenodd"
102
+ }
103
+ )
104
+ }
105
+ );
106
+ }
107
+ function UploadListItem({ file, onRemove, disabled }) {
108
+ const closeBtnClasses = [
109
+ "flex w-12 h-12 shrink-0 items-center justify-center rounded-rad-md outline-none transition-all duration-150",
110
+ !disabled && "bg-fill-action-secondary text-text-action-secondary",
111
+ !disabled && "hover:bg-fill-action-secondary-hover active:bg-fill-action-secondary-active",
112
+ !disabled && "focus-visible:bg-fill-action-secondary-focus",
113
+ !disabled && "focus-visible:ring-[1.5px] focus-visible:ring-border-focus focus-visible:ring-offset-[3px] focus-visible:rounded-rad-lg",
114
+ disabled && "bg-fill-action-secondary-disabled text-text-action-secondary-disabled cursor-not-allowed"
115
+ ].filter(Boolean).join(" ");
116
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-space-2", children: [
117
+ /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 self-stretch items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex h-full min-w-0 flex-1 items-center gap-space-2 rounded-rad-md border border-border-form-primary bg-fill-bg-primary px-space-4", children: [
118
+ disabled ? /* @__PURE__ */ jsx("span", { className: "text-icon-primary-disabled shrink-0", children: /* @__PURE__ */ jsx(FileIconDisabled, { className: "h-[16.667px] w-[13.333px]" }) }) : /* @__PURE__ */ jsx("span", { className: "text-icon-primary shrink-0", children: /* @__PURE__ */ jsx(FileIcon, { className: "w-5 h-5", disabled: false }) }),
119
+ /* @__PURE__ */ jsx(
120
+ "span",
121
+ {
122
+ className: `min-w-0 flex-1 truncate text-text-sm ${disabled ? "text-text-disabled" : "text-text-primary"}`,
123
+ title: file.name,
124
+ children: file.name
125
+ }
126
+ )
127
+ ] }) }),
128
+ /* @__PURE__ */ jsx(
129
+ "button",
130
+ {
131
+ type: "button",
132
+ disabled,
133
+ onClick: onRemove,
134
+ "aria-label": `Remove ${file.name}`,
135
+ className: closeBtnClasses,
136
+ children: /* @__PURE__ */ jsx(
137
+ CloseIcon,
138
+ {
139
+ className: `w-6 h-6 shrink-0 ${disabled ? "opacity-50" : ""}`
140
+ }
141
+ )
142
+ }
143
+ )
144
+ ] });
145
+ }
146
+ function UploadInput({
147
+ label,
148
+ secondaryLabel,
149
+ supportText,
150
+ uploadLabel = "Upload",
151
+ onFilesChange,
152
+ error = false,
153
+ errorMessage,
154
+ disabled,
155
+ className,
156
+ id: idProp,
157
+ multiple,
158
+ accept,
159
+ ref,
160
+ ...rest
161
+ }) {
162
+ const autoId = useId();
163
+ const id = idProp ?? autoId;
164
+ const inputRef = useRef(null);
165
+ const [files, setFiles] = useState([]);
166
+ const handleInputChange = (e) => {
167
+ const selected = e.target.files;
168
+ if (!(selected == null ? void 0 : selected.length)) return;
169
+ const next = multiple ? [...files, ...Array.from(selected)] : [selected[0]];
170
+ setFiles(next);
171
+ onFilesChange == null ? void 0 : onFilesChange(next);
172
+ e.target.value = "";
173
+ };
174
+ const removeFile = (index) => {
175
+ const next = files.filter((_, i) => i !== index);
176
+ setFiles(next);
177
+ onFilesChange == null ? void 0 : onFilesChange(next);
178
+ };
179
+ const triggerClick = () => {
180
+ var _a;
181
+ if (disabled) return;
182
+ (_a = inputRef.current) == null ? void 0 : _a.click();
183
+ };
184
+ const showErrorAlert = error && errorMessage;
185
+ const hasFiles = files.length > 0;
186
+ const buttonClasses = [
187
+ "flex h-12 items-center justify-center gap-space-2 self-stretch rounded-rad-md px-space-5 outline-none transition-all duration-150",
188
+ "text-form-text font-medium leading-[1.4]",
189
+ !disabled && !hasFiles && "bg-fill-action-secondary text-text-action-secondary",
190
+ !disabled && hasFiles && "bg-fill-action-secondary-active text-text-action-secondary",
191
+ !disabled && "hover:bg-fill-action-secondary-hover",
192
+ !disabled && "active:bg-fill-action-secondary-active",
193
+ !disabled && "focus-visible:bg-fill-action-secondary-focus",
194
+ !disabled && "focus-visible:ring-[1.5px] focus-visible:ring-border-focus focus-visible:ring-offset-[3px]",
195
+ disabled && "cursor-not-allowed bg-fill-action-secondary-disabled text-text-action-secondary-disabled",
196
+ className
197
+ ].filter(Boolean).join(" ");
198
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-space-2 w-full", children: [
199
+ (label || supportText) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-space-1", children: [
200
+ label && /* @__PURE__ */ jsxs(
201
+ "span",
202
+ {
203
+ className: `text-form-label ${disabled ? "text-text-disabled" : "text-text-primary"}`,
204
+ children: [
205
+ label,
206
+ secondaryLabel && /* @__PURE__ */ jsx("span", { className: "ml-1 font-normal text-text-secondary", children: secondaryLabel })
207
+ ]
208
+ }
209
+ ),
210
+ supportText && /* @__PURE__ */ jsx(
211
+ "p",
212
+ {
213
+ className: `text-text-xs ${disabled ? "text-text-disabled" : "text-text-secondary"}`,
214
+ children: supportText
215
+ }
216
+ )
217
+ ] }),
218
+ /* @__PURE__ */ jsx(
219
+ "input",
220
+ {
221
+ ref: (el) => {
222
+ inputRef.current = el;
223
+ if (typeof ref === "function") ref(el);
224
+ else if (ref != null) {
225
+ const r = ref;
226
+ r.current = el;
227
+ }
228
+ },
229
+ type: "file",
230
+ id,
231
+ disabled,
232
+ multiple,
233
+ accept,
234
+ onChange: handleInputChange,
235
+ className: "sr-only",
236
+ "aria-invalid": error || void 0,
237
+ "aria-describedby": showErrorAlert ? `${id}-error` : void 0,
238
+ ...rest
239
+ }
240
+ ),
241
+ /* @__PURE__ */ jsxs(
242
+ "button",
243
+ {
244
+ type: "button",
245
+ disabled,
246
+ onClick: triggerClick,
247
+ className: buttonClasses,
248
+ "aria-label": uploadLabel,
249
+ children: [
250
+ /* @__PURE__ */ jsx("span", { children: uploadLabel }),
251
+ /* @__PURE__ */ jsx(
252
+ "span",
253
+ {
254
+ className: disabled ? "text-icon-primary-disabled" : "text-icon-primary",
255
+ children: /* @__PURE__ */ jsx(UploadIcon, { className: "h-6 w-6 shrink-0" })
256
+ }
257
+ )
258
+ ]
259
+ }
260
+ ),
261
+ hasFiles && /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-space-2", "aria-label": "Uploaded files", children: files.map((file, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
262
+ UploadListItem,
263
+ {
264
+ file,
265
+ onRemove: () => removeFile(index),
266
+ disabled
267
+ }
268
+ ) }, `${file.name}-${index}`)) }),
269
+ showErrorAlert && /* @__PURE__ */ jsxs(
270
+ "div",
271
+ {
272
+ id: `${id}-error`,
273
+ role: "alert",
274
+ className: `flex items-start gap-space-4 rounded-rad-md p-space-4 ${disabled ? "bg-fill-bg-secondary" : "bg-fill-bg-err"}`,
275
+ children: [
276
+ /* @__PURE__ */ jsx(
277
+ ErrorIcon,
278
+ {
279
+ className: `h-5 w-5 shrink-0 ${disabled ? "text-icon-primary-disabled" : "text-icon-err"}`
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsx(
283
+ "span",
284
+ {
285
+ className: `text-text-xs ${disabled ? "text-text-disabled" : "text-text-err"}`,
286
+ children: errorMessage
287
+ }
288
+ )
289
+ ]
290
+ }
291
+ )
292
+ ] });
293
+ }
294
+ export {
295
+ UploadInput
296
+ };
297
+ //# sourceMappingURL=UploadInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UploadInput.js","sources":["../../../src/components/UploadInput/UploadInput.tsx"],"sourcesContent":["'use client';\n\nimport React, { useId, useRef, useState } from 'react';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype InputRef = React.MutableRefObject<HTMLInputElement | null>;\n\n/**\n * Props for the UploadInput component. Renders a file input (hidden) plus a visible\n * upload button and a list of selected files with remove. Use accept to limit file types\n * (e.g. \"image/*\", \".pdf\"); use multiple for multi-file selection. No drag-and-drop;\n * user clicks the button to open the file picker. onFilesChange is called after add or remove.\n */\nexport interface UploadInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {\n /** Label text displayed above the upload button. @default undefined */\n label?: string;\n /** Secondary label shown lighter beside the main label. @default undefined */\n secondaryLabel?: string;\n /** Supportive text rendered below the label. @default undefined */\n supportText?: string;\n /** Label on the upload button. @default 'Upload' */\n uploadLabel?: string;\n /** Called when the file list changes (user adds or removes a file). Receives the new File[]. @default undefined */\n onFilesChange?: (files: File[]) => void;\n /** Places the component in an error state. @default false */\n error?: boolean;\n /** Error message shown in the alert below when error is true. @default undefined */\n errorMessage?: string;\n /** Forwarded ref for the native file input. @default undefined */\n ref?: React.Ref<HTMLInputElement>;\n}\n\n// ---------------------------------------------------------------------------\n// Icons\n// ---------------------------------------------------------------------------\n\nfunction UploadIcon({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.25\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 15V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V15M17 8L12 3M12 3L7 8M12 3V15\" />\n </svg>\n );\n}\n\nfunction FileIcon({ className, disabled }: { className?: string; disabled?: boolean }) {\n return (\n <svg\n className={className}\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M11.6668 1.89136V5.33348C11.6668 5.80018 11.6668 6.03354 11.7577 6.2118C11.8376 6.3686 11.965 6.49608 12.1218 6.57598C12.3001 6.66681 12.5335 6.66681 13.0002 6.66681H16.4423M11.6668 14.1667H6.66683M13.3335 10.8334H6.66683M16.6668 8.3236V14.3334C16.6668 15.7335 16.6668 16.4336 16.3943 16.9684C16.1547 17.4388 15.7722 17.8212 15.3018 18.0609C14.767 18.3334 14.067 18.3334 12.6668 18.3334H7.3335C5.93336 18.3334 5.2333 18.3334 4.69852 18.0609C4.22811 17.8212 3.84566 17.4388 3.60598 16.9684C3.3335 16.4336 3.3335 15.7335 3.3335 14.3334V5.66675C3.3335 4.26662 3.3335 3.56655 3.60598 3.03177C3.84566 2.56137 4.22811 2.17892 4.69852 1.93923C5.2333 1.66675 5.93336 1.66675 7.3335 1.66675H10.01C10.6215 1.66675 10.9272 1.66675 11.2149 1.73582C11.47 1.79707 11.7139 1.89808 11.9375 2.03515C12.1898 2.18975 12.406 2.40594 12.8384 2.83832L15.4953 5.49517C15.9276 5.92755 16.1438 6.14374 16.2984 6.39604C16.4355 6.61972 16.5365 6.86358 16.5978 7.11867C16.6668 7.40639 16.6668 7.71213 16.6668 8.3236Z\"\n strokeOpacity={disabled ? 0.5 : undefined}\n />\n </svg>\n );\n}\n\nfunction FileIconDisabled({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n width=\"14\"\n height=\"17\"\n viewBox=\"0 0 15 19\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M9.08333 0.974609V4.41673C9.08333 4.88344 9.08333 5.11679 9.17416 5.29505C9.25406 5.45185 9.38154 5.57934 9.53834 5.65923C9.7166 5.75006 9.94996 5.75006 10.4167 5.75006H13.8588M9.08333 13.25H4.08333M10.75 9.91667H4.08333M14.0833 7.40685V13.4167C14.0833 14.8168 14.0833 15.5169 13.8108 16.0516C13.5712 16.522 13.1887 16.9045 12.7183 17.1442C12.1835 17.4167 11.4835 17.4167 10.0833 17.4167H4.75C3.34987 17.4167 2.6498 17.4167 2.11502 17.1442C1.64462 16.9045 1.26217 16.522 1.02248 16.0516C0.75 15.5169 0.75 14.8168 0.75 13.4167V4.75C0.75 3.34987 0.75 2.6498 1.02248 2.11502C1.26217 1.64462 1.64462 1.26217 2.11502 1.02248C2.6498 0.75 3.34987 0.75 4.75 0.75H7.42648C8.03796 0.75 8.34369 0.75 8.63141 0.819075C8.8865 0.880317 9.13036 0.981328 9.35405 1.1184C9.60634 1.273 9.82253 1.48919 10.2549 1.92157L12.9118 4.57843C13.3441 5.01081 13.5603 5.227 13.7149 5.47929C13.852 5.70297 13.953 5.94683 14.0143 6.20192C14.0833 6.48964 14.0833 6.79538 14.0833 7.40685Z\"\n strokeOpacity={0.5}\n />\n </svg>\n );\n}\n\nfunction CloseIcon({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.25\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M17 7L7 17M7 7L17 17\" />\n </svg>\n );\n}\n\nfunction ErrorIcon({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Upload list item\n// ---------------------------------------------------------------------------\n\ninterface UploadListItemProps {\n file: File;\n onRemove: () => void;\n disabled?: boolean;\n}\n\nfunction UploadListItem({ file, onRemove, disabled }: UploadListItemProps) {\n const closeBtnClasses = [\n 'flex w-12 h-12 shrink-0 items-center justify-center rounded-rad-md outline-none transition-all duration-150',\n !disabled && 'bg-fill-action-secondary text-text-action-secondary',\n !disabled && 'hover:bg-fill-action-secondary-hover active:bg-fill-action-secondary-active',\n !disabled && 'focus-visible:bg-fill-action-secondary-focus',\n !disabled && 'focus-visible:ring-[1.5px] focus-visible:ring-border-focus focus-visible:ring-offset-[3px] focus-visible:rounded-rad-lg',\n disabled && 'bg-fill-action-secondary-disabled text-text-action-secondary-disabled cursor-not-allowed',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"flex items-center gap-space-2\">\n <div className=\"flex min-w-0 flex-1 self-stretch items-center\">\n <div className=\"flex h-full min-w-0 flex-1 items-center gap-space-2 rounded-rad-md border border-border-form-primary bg-fill-bg-primary px-space-4\">\n {disabled ? (\n <span className=\"text-icon-primary-disabled shrink-0\">\n <FileIconDisabled className=\"h-[16.667px] w-[13.333px]\" />\n </span>\n ) : (\n <span className=\"text-icon-primary shrink-0\">\n <FileIcon className=\"w-5 h-5\" disabled={false} />\n </span>\n )}\n <span\n className={`min-w-0 flex-1 truncate text-text-sm ${\n disabled ? 'text-text-disabled' : 'text-text-primary'\n }`}\n title={file.name}\n >\n {file.name}\n </span>\n </div>\n </div>\n\n <button\n type=\"button\"\n disabled={disabled}\n onClick={onRemove}\n aria-label={`Remove ${file.name}`}\n className={closeBtnClasses}\n >\n <CloseIcon\n className={`w-6 h-6 shrink-0 ${\n disabled ? 'opacity-50' : ''\n }`}\n />\n </button>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * File upload control: a visible upload button (opens the file picker) and a list of\n * selected files with remove buttons. Pass accept (e.g. \"image/*\") to limit types;\n * pass multiple to allow multiple selection. onFilesChange is called when files are\n * added or removed. No drag-and-drop; use the button to select files.\n *\n * @example\n * <UploadInput label=\"Document\" uploadLabel=\"Choose file\" onFilesChange={setFiles} accept=\".pdf\" />\n *\n * @example\n * <UploadInput label=\"Images\" multiple accept=\"image/*\" error={!!err} errorMessage={err} />\n */\nexport function UploadInput({\n label,\n secondaryLabel,\n supportText,\n uploadLabel = 'Upload',\n onFilesChange,\n error = false,\n errorMessage,\n disabled,\n className,\n id: idProp,\n multiple,\n accept,\n ref,\n ...rest\n}: UploadInputProps) {\n const autoId = useId();\n const id = idProp ?? autoId;\n const inputRef = useRef<HTMLInputElement | null>(null) as React.MutableRefObject<HTMLInputElement | null>;\n\n const [files, setFiles] = useState<File[]>([]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const selected = e.target.files;\n if (!selected?.length) return;\n const next = multiple ? [...files, ...Array.from(selected)] : [selected[0]!];\n setFiles(next);\n onFilesChange?.(next);\n e.target.value = '';\n };\n\n const removeFile = (index: number) => {\n const next = files.filter((_, i) => i !== index);\n setFiles(next);\n onFilesChange?.(next);\n };\n\n const triggerClick = () => {\n if (disabled) return;\n inputRef.current?.click();\n };\n\n const showErrorAlert = error && errorMessage;\n const hasFiles = files.length > 0;\n\n const buttonClasses = [\n 'flex h-12 items-center justify-center gap-space-2 self-stretch rounded-rad-md px-space-5 outline-none transition-all duration-150',\n 'text-form-text font-medium leading-[1.4]',\n !disabled && !hasFiles && 'bg-fill-action-secondary text-text-action-secondary',\n !disabled && hasFiles && 'bg-fill-action-secondary-active text-text-action-secondary',\n !disabled && 'hover:bg-fill-action-secondary-hover',\n !disabled && 'active:bg-fill-action-secondary-active',\n !disabled && 'focus-visible:bg-fill-action-secondary-focus',\n !disabled && 'focus-visible:ring-[1.5px] focus-visible:ring-border-focus focus-visible:ring-offset-[3px]',\n disabled && 'cursor-not-allowed bg-fill-action-secondary-disabled text-text-action-secondary-disabled',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"flex flex-col gap-space-2 w-full\">\n {/* Label + support text */}\n {(label || supportText) && (\n <div className=\"flex flex-col gap-space-1\">\n {label && (\n <span\n className={`text-form-label ${\n disabled ? 'text-text-disabled' : 'text-text-primary'\n }`}\n >\n {label}\n {secondaryLabel && (\n <span className=\"ml-1 font-normal text-text-secondary\">\n {secondaryLabel}\n </span>\n )}\n </span>\n )}\n {supportText && (\n <p\n className={`text-text-xs ${\n disabled ? 'text-text-disabled' : 'text-text-secondary'\n }`}\n >\n {supportText}\n </p>\n )}\n </div>\n )}\n\n {/* Hidden file input */}\n <input\n ref={(el) => {\n inputRef.current = el;\n if (typeof ref === 'function') ref(el);\n else if (ref != null) {\n const r = (ref as unknown) as InputRef;\n r.current = el;\n }\n }}\n type=\"file\"\n id={id}\n disabled={disabled}\n multiple={multiple}\n accept={accept}\n onChange={handleInputChange}\n className=\"sr-only\"\n aria-invalid={error || undefined}\n aria-describedby={showErrorAlert ? `${id}-error` : undefined}\n {...rest}\n />\n\n {/* Upload button (triggers file input) */}\n <button\n type=\"button\"\n disabled={disabled}\n onClick={triggerClick}\n className={buttonClasses}\n aria-label={uploadLabel}\n >\n <span>{uploadLabel}</span>\n <span\n className={\n disabled ? 'text-icon-primary-disabled' : 'text-icon-primary'\n }\n >\n <UploadIcon className=\"h-6 w-6 shrink-0\" />\n </span>\n </button>\n\n {/* Upload list */}\n {hasFiles && (\n <ul className=\"flex flex-col gap-space-2\" aria-label=\"Uploaded files\">\n {files.map((file, index) => (\n <li key={`${file.name}-${index}`}>\n <UploadListItem\n file={file}\n onRemove={() => removeFile(index)}\n disabled={disabled}\n />\n </li>\n ))}\n </ul>\n )}\n\n {/* Error alert */}\n {showErrorAlert && (\n <div\n id={`${id}-error`}\n role=\"alert\"\n className={`flex items-start gap-space-4 rounded-rad-md p-space-4 ${\n disabled ? 'bg-fill-bg-secondary' : 'bg-fill-bg-err'\n }`}\n >\n <ErrorIcon\n className={`h-5 w-5 shrink-0 ${\n disabled ? 'text-icon-primary-disabled' : 'text-icon-err'\n }`}\n />\n <span\n className={`text-text-xs ${\n disabled ? 'text-text-disabled' : 'text-text-err'\n }`}\n >\n {errorMessage}\n </span>\n </div>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;AAwCA;AACE;AACE;AAAC;AAAA;AACC;AACM;AACC;AACC;AACH;AACE;AACK;AACE;AACC;AACH;AAE0Q;AAAA;AAG5R;AAEA;AACE;AACE;AAAC;AAAA;AACC;AACM;AACC;AACC;AACH;AACE;AACK;AACE;AACC;AACH;AAEZ;AAAC;AAAA;AACG;AAC8B;AAAA;AAAA;AAClC;AAGN;AAEA;AACE;AACE;AAAC;AAAA;AACC;AACM;AACC;AACC;AACH;AACE;AACK;AACE;AACC;AACH;AAEZ;AAAC;AAAA;AACG;AACa;AAAA;AAAA;AACjB;AAGN;AAEA;AACE;AACE;AAAC;AAAA;AACC;AACM;AACC;AACC;AACH;AACE;AACK;AACE;AACC;AACH;AAEmB;AAAA;AAGrC;AAEA;AACE;AACE;AAAC;AAAA;AACC;AACQ;AACH;AACO;AAEZ;AAAC;AAAA;AACU;AACP;AACO;AAAA;AAAA;AACX;AAGN;AAYA;AACE;AAAwB;AACtB;AACa;AACA;AACA;AACA;AACD;AAKd;AAEI;AAEK;AAOC;AAEF;AAAC;AAAA;AAGC;AACY;AAEN;AAAA;AAAA;AAGZ;AAEA;AAAC;AAAA;AACM;AACL;AACS;AACsB;AACpB;AAEX;AAAC;AAAA;AAGC;AAAA;AAAA;AACF;AAAA;AAIR;AAkBO;AAAqB;AAC1B;AACA;AACA;AACc;AACd;AACQ;AACR;AACA;AACA;AACI;AACJ;AACA;AACA;AAEF;AACE;AACA;AACA;AAEA;AAEA;AACE;AACA;AACA;AACA;AACA;AACA;AAAiB;AAGnB;AACE;AACA;AACA;AAAgB;AAGlB;;AACE;AACA;AAAkB;AAGpB;AACA;AAEA;AAAsB;AACpB;AACA;AAC0B;AACD;AACZ;AACA;AACA;AACA;AACD;AACZ;AAKF;AAGM;AAEG;AACC;AAAC;AAAA;AAGC;AAEC;AAAA;AAIC;AAAA;AAAA;AAAA;AAKJ;AAAC;AAAA;AAGC;AAEC;AAAA;AAAA;AAGP;AAIF;AAAC;AAAA;AAEG;AACA;AAAqC;AAEnC;AACA;AAAY;AACd;AACF;AACK;AACL;AACA;AACA;AACA;AACU;AACA;AACa;AAC4B;AAC/C;AAAA;AAAA;AAIN;AAAC;AAAA;AACM;AACL;AACS;AACE;AACC;AAEZ;AAAmB;AACnB;AAAC;AAAA;AAE6C;AAGH;AAAA;AAAA;AAC3C;AAAA;AAAA;AAQM;AAAC;AAAA;AACC;AACgC;AAChC;AAAA;AAIR;AAKA;AAAC;AAAA;AACU;AACJ;AAGL;AAEA;AAAA;AAAC;AAAA;AAGC;AAAA;AAAA;AAEF;AAAC;AAAA;AAGC;AAEC;AAAA;AAAA;AACH;AAAA;AAAA;AAKV;;;;"}
@@ -0,0 +1,65 @@
1
+ export { Typography } from './Typography/Typography';
2
+ export type { TypographyProps } from './Typography/Typography';
3
+ export { Button } from './Button/Button';
4
+ export type { ButtonProps } from './Button/Button';
5
+ export { Link } from './Link/Link';
6
+ export type { LinkProps } from './Link/Link';
7
+ export { Breadcrumb } from './Breadcrumb/Breadcrumb';
8
+ export type { BreadcrumbProps, BreadcrumbItem, BreadcrumbSeparator } from './Breadcrumb/Breadcrumb';
9
+ export { Accordion, AccordionSpecs } from './Accordion/Accordion';
10
+ export type { AccordionProps, AccordionSpecsProps } from './Accordion/Accordion';
11
+ export { FAQ } from './FAQ/FAQ';
12
+ export type { FAQProps } from './FAQ/FAQ';
13
+ export { Tab } from './Tab/Tab';
14
+ export type { TabProps } from './Tab/Tab';
15
+ export { Grid } from './Grid/Grid';
16
+ export type { GridProps } from './Grid/Grid';
17
+ export { Container } from './Container/Container';
18
+ export type { ContainerProps, ContainerMaxWidth } from './Container/Container';
19
+ export { TextInput } from './TextInput/TextInput';
20
+ export type { TextInputProps } from './TextInput/TextInput';
21
+ export { TextArea } from './TextArea/TextArea';
22
+ export type { TextAreaProps } from './TextArea/TextArea';
23
+ export { Select } from './Select/Select';
24
+ export type { SelectProps, SelectOption } from './Select/Select';
25
+ export { SelectTab } from './SelectTab/SelectTab';
26
+ export type { SelectTabProps, SelectTabOption } from './SelectTab/SelectTab';
27
+ export { DateInput } from './DateInput/DateInput';
28
+ export type { DateInputProps, DateValue } from './DateInput/DateInput';
29
+ export { PhoneInput, EAST_AFRICA_COUNTRIES } from './PhoneInput/PhoneInput';
30
+ export type { PhoneInputProps, PhoneCountry } from './PhoneInput/PhoneInput';
31
+ export { UploadInput } from './UploadInput/UploadInput';
32
+ export type { UploadInputProps } from './UploadInput/UploadInput';
33
+ export { RadioGroup } from './RadioGroup/RadioGroup';
34
+ export type { RadioGroupProps, RadioOption } from './RadioGroup/RadioGroup';
35
+ export { CheckboxGroup } from './CheckboxGroup/CheckboxGroup';
36
+ export type { CheckboxGroupProps, CheckboxOption } from './CheckboxGroup/CheckboxGroup';
37
+ export { Slider } from './Slider/Slider';
38
+ export type { SliderProps } from './Slider/Slider';
39
+ export { Toggle, ToggleButton } from './Toggle/Toggle';
40
+ export type { ToggleProps, ToggleButtonProps, ToggleOption, ToggleSize } from './Toggle/Toggle';
41
+ export { Card } from './Card/Card';
42
+ export type { CardProps, CardType } from './Card/Card';
43
+ export { ProductImage, ProductImageGallery } from './ProductImage/ProductImage';
44
+ export type { ProductImageProps, ProductImageGalleryProps, GalleryImage } from './ProductImage/ProductImage';
45
+ export { Box } from './Box/Box';
46
+ export type { BoxProps, ResponsiveValue } from './Box/Box';
47
+ export { Stack } from './Stack/Stack';
48
+ export type { StackProps, StackDirection, StackAlign, StackJustify } from './Stack/Stack';
49
+ export { Divider } from './Divider/Divider';
50
+ export type { DividerProps, DividerOrientation, DividerVariant } from './Divider/Divider';
51
+ export { Overlay } from './Overlay/Overlay';
52
+ export type { OverlayProps } from './Overlay/Overlay';
53
+ export { Drawer } from './Drawer/Drawer';
54
+ export type { DrawerProps, DrawerAnchor } from './Drawer/Drawer';
55
+ export { Popover } from './Popover/Popover';
56
+ export type { PopoverProps, PopoverAlign } from './Popover/Popover';
57
+ export { Icon } from './Icon/Icon';
58
+ export type { IconProps, IconName } from './Icon/Icon';
59
+ export { Section } from './Section/Section';
60
+ export type { SectionProps, SectionSize } from './Section/Section';
61
+ export { Skeleton } from './Skeleton';
62
+ export type { SkeletonProps, SkeletonRadius } from './Skeleton';
63
+ export { List } from './List';
64
+ export type { ListProps, ListItemProps, ListMarker, ListItemSize } from './List';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CA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AY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { Typography, Button, Link, Accordion, AccordionSpecs, FAQ, Tab, Grid, Container, Box, Stack, Divider, Overlay, Drawer, Popover, TextInput, TextArea, Select, SelectTab, DateInput, PhoneInput, EAST_AFRICA_COUNTRIES, UploadInput, RadioGroup, CheckboxGroup, Slider, Toggle, ToggleButton, Card, ProductImage, ProductImageGallery, Icon, Section, Skeleton, List, } from './components';
2
+ export type { TypographyProps, ButtonProps, LinkProps, AccordionProps, AccordionSpecsProps, FAQProps, TabProps, GridProps, ContainerProps, ContainerMaxWidth, BoxProps, ResponsiveValue, StackProps, StackDirection, StackAlign, StackJustify, DividerProps, DividerOrientation, DividerVariant, OverlayProps, DrawerProps, DrawerAnchor, PopoverProps, PopoverAlign, TextInputProps, TextAreaProps, SelectProps, SelectOption, SelectTabProps, SelectTabOption, DateInputProps, DateValue, PhoneInputProps, PhoneCountry, UploadInputProps, RadioGroupProps, RadioOption, CheckboxGroupProps, CheckboxOption, SliderProps, ToggleProps, ToggleButtonProps, ToggleOption, ToggleSize, CardProps, CardType, ProductImageProps, ProductImageGalleryProps, GalleryImage, IconProps, IconName, SectionProps, SectionSize, SkeletonProps, SkeletonRadius, ListProps, ListItemProps, ListMarker, ListItemSize, } from './components';
3
+ export type { TypographyVariant, TypographyElement, ButtonVariant, ButtonSize, LinkVariant, LinkSize, AccordionItem, AccordionVariant, AccordionSpecItem, FAQItem, TabItem, } from './types';
4
+ export type { FixedSpacingToken, FluidSpacingToken, SpacingToken, MarginToken, SpacingProps, GapProps, } from './types/spacing';
5
+ export type { DisplayValue, AlignItemsValue, JustifyContentValue, FlexDirectionValue, FlexWrapValue, AlignSelfValue, LayoutProps, StackLayoutProps, } from './types/layout';
6
+ export type { JiwambePluginOptions, TypographyDef, } from './plugin/jiwambe-plugin';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,SAAS,EACT,cAAc,EACd,GAAG,EACH,GAAG,EACH,IAAI,EACJ,SAAS,EACT,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,IAAI,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pB,aAAa,GACd,MAAM,yBAAyB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ import { Accordion, AccordionSpecs } from "./components/Accordion/Accordion.js";
2
+ import { Box } from "./components/Box/Box.js";
3
+ import { Button } from "./components/Button/Button.js";
4
+ import { Card } from "./components/Card/Card.js";
5
+ import { CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup.js";
6
+ import { Container } from "./components/Container/Container.js";
7
+ import { DateInput } from "./components/DateInput/DateInput.js";
8
+ import { Divider } from "./components/Divider/Divider.js";
9
+ import { Drawer } from "./components/Drawer/Drawer.js";
10
+ import { EAST_AFRICA_COUNTRIES, PhoneInput } from "./components/PhoneInput/PhoneInput.js";
11
+ import { FAQ } from "./components/FAQ/FAQ.js";
12
+ import { Grid } from "./components/Grid/Grid.js";
13
+ import { Icon } from "./components/Icon/Icon.js";
14
+ import { Link } from "./components/Link/Link.js";
15
+ import { List } from "./components/List/List.js";
16
+ import { Overlay } from "./components/Overlay/Overlay.js";
17
+ import { Popover } from "./components/Popover/Popover.js";
18
+ import { ProductImage, ProductImageGallery } from "./components/ProductImage/ProductImage.js";
19
+ import { RadioGroup } from "./components/RadioGroup/RadioGroup.js";
20
+ import { Section } from "./components/Section/Section.js";
21
+ import { Select } from "./components/Select/Select.js";
22
+ import { SelectTab } from "./components/SelectTab/SelectTab.js";
23
+ import { Skeleton } from "./components/Skeleton/Skeleton.js";
24
+ import { Slider } from "./components/Slider/Slider.js";
25
+ import { Stack } from "./components/Stack/Stack.js";
26
+ import { Tab } from "./components/Tab/Tab.js";
27
+ import { TextArea } from "./components/TextArea/TextArea.js";
28
+ import { TextInput } from "./components/TextInput/TextInput.js";
29
+ import { Toggle, ToggleButton } from "./components/Toggle/Toggle.js";
30
+ import { Typography } from "./components/Typography/Typography.js";
31
+ import { UploadInput } from "./components/UploadInput/UploadInput.js";
32
+ export {
33
+ Accordion,
34
+ AccordionSpecs,
35
+ Box,
36
+ Button,
37
+ Card,
38
+ CheckboxGroup,
39
+ Container,
40
+ DateInput,
41
+ Divider,
42
+ Drawer,
43
+ EAST_AFRICA_COUNTRIES,
44
+ FAQ,
45
+ Grid,
46
+ Icon,
47
+ Link,
48
+ List,
49
+ Overlay,
50
+ PhoneInput,
51
+ Popover,
52
+ ProductImage,
53
+ ProductImageGallery,
54
+ RadioGroup,
55
+ Section,
56
+ Select,
57
+ SelectTab,
58
+ Skeleton,
59
+ Slider,
60
+ Stack,
61
+ Tab,
62
+ TextArea,
63
+ TextInput,
64
+ Toggle,
65
+ ToggleButton,
66
+ Typography,
67
+ UploadInput
68
+ };
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,37 @@
1
+ export interface TypographyDef {
2
+ fontFamily: string;
3
+ fontSize: string;
4
+ fontWeight: string;
5
+ lineHeight: string;
6
+ letterSpacing?: string;
7
+ textWrap?: string;
8
+ }
9
+ export interface JiwambePluginOptions {
10
+ /** Override or extend semantic color token mappings. */
11
+ colors?: Record<string, string>;
12
+ /** Override or extend spacing tokens. */
13
+ spacing?: Record<string, string>;
14
+ /** Override or extend border width tokens. */
15
+ borderWidth?: Record<string, string>;
16
+ /** Override or extend border radius tokens. */
17
+ borderRadius?: Record<string, string>;
18
+ /** Override or extend elevation (box-shadow) tokens. */
19
+ elevation?: Record<string, string>;
20
+ /** Override or extend typography definitions. Partial overrides are merged with defaults. */
21
+ typography?: Record<string, Partial<TypographyDef>>;
22
+ /** Override primary and/or secondary font families. */
23
+ fontFamily?: {
24
+ primary?: string;
25
+ secondary?: string;
26
+ };
27
+ }
28
+ export declare function resolve(ref: string, opacity?: number): string;
29
+ declare const jiwambePlugin: {
30
+ (options: JiwambePluginOptions | undefined): {
31
+ handler: import('tailwindcss/types/config').PluginCreator;
32
+ config?: Partial<import('tailwindcss/types/config').Config>;
33
+ };
34
+ __isOptionsFunction: true;
35
+ };
36
+ export default jiwambePlugin;
37
+ //# sourceMappingURL=jiwambe-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jiwambe-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/jiwambe-plugin.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACpD,uDAAuD;IACvD,UAAU,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD;AAmGD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAW7D;AA2cD,QAAA,MAAM,aAAa;;;cAjlBD,CAAC;;;CAuwBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}