@customafk/lunas-ui 0.0.2 → 0.0.3-a

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 (68) hide show
  1. package/dist/Atoms/AspectRatio/index.js +2 -0
  2. package/dist/Atoms/Avatar/index.js +3 -3
  3. package/dist/Atoms/Badge/index.js +2 -0
  4. package/dist/Atoms/Breadcrumb/index.js +7 -23
  5. package/dist/Atoms/Button/index.d.ts +2 -2
  6. package/dist/Atoms/Button/index.js +2 -0
  7. package/dist/Atoms/Card/index.js +2 -0
  8. package/dist/Atoms/Checkbox/index.d.ts +6 -0
  9. package/dist/Atoms/Checkbox/index.js +276 -0
  10. package/dist/Atoms/Command/index.d.ts +7 -7
  11. package/dist/Atoms/Command/index.js +39 -50
  12. package/dist/Atoms/Dialog/index.js +16 -31
  13. package/dist/Atoms/DropdownMenu/index.js +2 -0
  14. package/dist/Atoms/Form/index.js +32 -21
  15. package/dist/Atoms/Input/index.d.ts +5 -1
  16. package/dist/Atoms/Input/index.js +45 -543
  17. package/dist/Atoms/Label/index.js +2 -0
  18. package/dist/Atoms/MenuItem/index.d.ts +14 -0
  19. package/dist/Atoms/MenuItem/index.js +287 -0
  20. package/dist/Atoms/Money/index.js +2 -0
  21. package/dist/Atoms/Navbar/index.js +2 -0
  22. package/dist/Atoms/NavigationMenu/index.js +2 -0
  23. package/dist/Atoms/NumberInput/index.d.ts +7 -0
  24. package/dist/Atoms/NumberInput/index.js +321 -0
  25. package/dist/Atoms/Popover/index.d.ts +8 -0
  26. package/dist/Atoms/Popover/index.js +286 -0
  27. package/dist/Atoms/Progress/index.js +2 -0
  28. package/dist/Atoms/QuantityBtn/index.js +2 -0
  29. package/dist/Atoms/RadioGroup/index.d.ts +7 -0
  30. package/dist/Atoms/RadioGroup/index.js +285 -0
  31. package/dist/Atoms/ScrollBar/index.js +4 -2
  32. package/dist/Atoms/Select/index.js +2 -0
  33. package/dist/Atoms/Sheet/index.d.ts +29 -0
  34. package/dist/Atoms/Sheet/index.js +422 -0
  35. package/dist/Atoms/Slider/index.d.ts +6 -0
  36. package/dist/Atoms/Slider/index.js +286 -0
  37. package/dist/Atoms/SmallQuantityBtn/index.d.ts +9 -0
  38. package/dist/Atoms/SmallQuantityBtn/index.js +110 -0
  39. package/dist/Atoms/Switch/index.d.ts +6 -0
  40. package/dist/Atoms/Switch/index.js +293 -0
  41. package/dist/Atoms/Tabs/index.d.ts +9 -0
  42. package/dist/Atoms/Tabs/index.js +304 -0
  43. package/dist/Atoms/Textarea/index.d.ts +5 -0
  44. package/dist/Atoms/Textarea/index.js +283 -0
  45. package/dist/Atoms/Tooltip/index.d.ts +10 -0
  46. package/dist/Atoms/Tooltip/index.js +289 -0
  47. package/dist/Atoms/UserAvatar/index.d.ts +2 -2
  48. package/dist/Atoms/UserAvatar/index.js +24 -28
  49. package/dist/Atoms/XButton/index.d.ts +10 -0
  50. package/dist/Atoms/XButton/index.js +309 -0
  51. package/dist/Authentication/SignIn/index.d.ts +1 -1
  52. package/dist/Authentication/SignIn/index.js +129 -74
  53. package/dist/Authentication/SignUp/index.d.ts +5 -5
  54. package/dist/Authentication/SignUp/index.js +181 -110
  55. package/dist/Authentication/ThankYou/index.js +13 -4
  56. package/dist/Ecommerce/Categories/index.d.ts +33 -0
  57. package/dist/Ecommerce/Categories/index.js +1426 -0
  58. package/dist/Icons/index.d.ts +5 -3
  59. package/dist/Icons/index.js +126 -97
  60. package/dist/Molecules/AuthenForm/index.js +30 -21
  61. package/dist/Molecules/Search/index.js +46 -57
  62. package/dist/Molecules/UserDropdown/index.js +42 -33
  63. package/dist/Organisms/Header/index.d.ts +25 -3
  64. package/dist/Organisms/Header/index.js +585 -324
  65. package/dist/hooks/index.d.ts +1 -54
  66. package/dist/hooks/index.js +3 -127
  67. package/dist/{types-BgHhiNa-.d.ts → types-BlE003QY.d.ts} +1 -1
  68. package/package.json +85 -41
@@ -1,9 +1,11 @@
1
+ "use client";
2
+
1
3
  // packages/Atoms/Form/index.tsx
2
4
  import * as React2 from "react";
3
5
  import {
4
- Controller as ControllerBase,
5
- FormProvider as FormProviderBase,
6
- useFormContext as useFormContextBase
6
+ Controller,
7
+ FormProvider,
8
+ useFormContext
7
9
  } from "react-hook-form";
8
10
 
9
11
  // packages/Atoms/Label/index.tsx
@@ -266,17 +268,17 @@ Label.displayName = LabelPrimitive.Root.displayName;
266
268
  // packages/Atoms/Form/index.tsx
267
269
  import { Slot } from "@radix-ui/react-slot";
268
270
  import { jsx as jsx2 } from "react/jsx-runtime";
269
- var Form = FormProviderBase;
271
+ var Form = FormProvider;
270
272
  var FormFieldContext = React2.createContext({});
271
273
  var FormField = ({
272
274
  ...props
273
275
  }) => {
274
- return /* @__PURE__ */ jsx2(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx2(ControllerBase, { ...props }) });
276
+ return /* @__PURE__ */ jsx2(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx2(Controller, { ...props }) });
275
277
  };
276
278
  var useFormField = () => {
277
279
  const fieldContext = React2.useContext(FormFieldContext);
278
280
  const itemContext = React2.useContext(FormItemContext);
279
- const { getFieldState, formState } = useFormContextBase();
281
+ const { getFieldState, formState } = useFormContext();
280
282
  const fieldState = getFieldState(fieldContext.name, formState);
281
283
  if (!fieldContext) {
282
284
  throw new Error("useFormField should be used within <FormField>");
@@ -293,55 +295,64 @@ var useFormField = () => {
293
295
  };
294
296
  var FormItemContext = React2.createContext({});
295
297
  var FormItem = React2.forwardRef(
296
- ({ className, ...props }, reference) => {
298
+ ({ className, ...props }, ref) => {
297
299
  const id = React2.useId();
298
- return /* @__PURE__ */ jsx2(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx2("div", { ref: reference, className: cn("space-y-2", className), ...props }) });
300
+ return /* @__PURE__ */ jsx2(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx2("div", { ref, className: cn("space-y-2", className), ...props }) });
299
301
  }
300
302
  );
301
303
  FormItem.displayName = "FormItem";
302
- var FormLabel = React2.forwardRef(({ className, ...props }, reference) => {
304
+ var FormLabel = React2.forwardRef(({ className, ...props }, ref) => {
303
305
  const { error, formItemId } = useFormField();
304
306
  return /* @__PURE__ */ jsx2(
305
307
  Label,
306
308
  {
307
- ref: reference,
308
- className: cn(error && "text-destructive", className),
309
+ ref,
310
+ className: cn(error && "text-ui-destructive-500", className),
309
311
  htmlFor: formItemId,
310
312
  ...props
311
313
  }
312
314
  );
313
315
  });
314
316
  FormLabel.displayName = "FormLabel";
315
- var FormControl = React2.forwardRef(({ ...props }, reference) => {
316
- const { formItemId } = useFormField();
317
- return /* @__PURE__ */ jsx2(Slot, { ref: reference, id: formItemId, ...props });
317
+ var FormControl = React2.forwardRef(({ ...props }, ref) => {
318
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
319
+ return /* @__PURE__ */ jsx2(
320
+ Slot,
321
+ {
322
+ ref,
323
+ id: formItemId,
324
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
325
+ "aria-invalid": !!error,
326
+ ...props
327
+ }
328
+ );
318
329
  });
319
330
  FormControl.displayName = "FormControl";
320
- var FormDescription = React2.forwardRef(({ className, ...props }, reference) => {
331
+ var FormDescription = React2.forwardRef(({ className, ...props }, ref) => {
321
332
  const { formDescriptionId } = useFormField();
322
333
  return /* @__PURE__ */ jsx2(
323
334
  "p",
324
335
  {
325
- ref: reference,
336
+ ref,
326
337
  id: formDescriptionId,
327
- className: cn("text-muted-foreground text-sm", className),
338
+ className: cn("text-sm text-ui-text-500", className),
328
339
  ...props
329
340
  }
330
341
  );
331
342
  });
332
343
  FormDescription.displayName = "FormDescription";
333
- var FormMessage = React2.forwardRef(({ className, children, ...props }, reference) => {
344
+ var FormMessage = React2.forwardRef(({ className, children, ...props }, ref) => {
334
345
  const { error, formMessageId } = useFormField();
335
346
  const body = error ? String(error?.message) : children;
336
347
  if (!body) {
337
- return void 0;
348
+ return null;
338
349
  }
339
350
  return /* @__PURE__ */ jsx2(
340
351
  "p",
341
352
  {
342
- ref: reference,
353
+ ref,
343
354
  id: formMessageId,
344
- className: cn("text-destructive text-sm font-medium", className),
355
+ className: cn("text-sm font-medium text-ui-destructive-500", className),
345
356
  ...props,
346
357
  children: body
347
358
  }
@@ -1,11 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { HTMLAttributes, ReactNode, ChangeEvent } from 'react';
3
3
 
4
- interface IInputProps extends HTMLAttributes<HTMLDivElement> {
4
+ interface IInputProps extends HTMLAttributes<HTMLInputElement> {
5
5
  icon?: ReactNode;
6
6
  placeholder?: string;
7
7
  isErrored?: boolean;
8
+ inputClassName?: string;
9
+ value?: string | number | readonly string[];
8
10
  onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
11
+ onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
12
+ onFocus?: (event: ChangeEvent<HTMLInputElement>) => void;
9
13
  }
10
14
  declare const Input: React.MemoExoticComponent<React.ForwardRefExoticComponent<IInputProps & React.RefAttributes<HTMLDivElement>>>;
11
15