@timardex/cluemart-shared 1.0.73 → 1.0.74

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.
package/dist/index.d.mts CHANGED
@@ -384,7 +384,8 @@ interface Subcategory {
384
384
  items?: SubcategoryItems[] | null;
385
385
  }
386
386
  interface Category {
387
- description?: string;
387
+ color?: string | null;
388
+ description?: string | null;
388
389
  id: string;
389
390
  name: string;
390
391
  subcategories: Subcategory[];
@@ -632,8 +633,8 @@ declare const validateVerificationTokenFields: FormField[];
632
633
 
633
634
  declare const profileFields: FormField[];
634
635
 
635
- declare const availableCategories: Category[];
636
636
  declare const categoryColors: Record<string, string>;
637
+ declare const availableCategories: Category[];
637
638
 
638
639
  declare const socialMediaFields: FormField[];
639
640
 
package/dist/index.d.ts CHANGED
@@ -384,7 +384,8 @@ interface Subcategory {
384
384
  items?: SubcategoryItems[] | null;
385
385
  }
386
386
  interface Category {
387
- description?: string;
387
+ color?: string | null;
388
+ description?: string | null;
388
389
  id: string;
389
390
  name: string;
390
391
  subcategories: Subcategory[];
@@ -632,8 +633,8 @@ declare const validateVerificationTokenFields: FormField[];
632
633
 
633
634
  declare const profileFields: FormField[];
634
635
 
635
- declare const availableCategories: Category[];
636
636
  declare const categoryColors: Record<string, string>;
637
+ declare const availableCategories: Category[];
637
638
 
638
639
  declare const socialMediaFields: FormField[];
639
640
 
package/dist/index.mjs CHANGED
@@ -824,6 +824,25 @@ var profileFields = [
824
824
  ];
825
825
 
826
826
  // src/formFields/categories.ts
827
+ var categoryColors = {
828
+ "antiques-collectibles": "#8D6748",
829
+ "clothing-fashion": "#9D4EDD",
830
+ "electronics-technology": "#3AF3FF",
831
+ "food-beverages": "#FF0D1F",
832
+ "handmade-local-products": "#EE7E54",
833
+ "health-wellness": "#E23794",
834
+ "home-garden-household-goods": "#067325",
835
+ "pet-products-animal-goods": "#68E788",
836
+ "services-experiences": "#2E16A5",
837
+ "toys-childrens-items": "#FFF966"
838
+ };
839
+ var assignColorToCategories = (categories) => {
840
+ const result = categories.map((category) => ({
841
+ ...category,
842
+ color: categoryColors[category.id]
843
+ }));
844
+ return result;
845
+ };
827
846
  var foodAndBeverages = [
828
847
  {
829
848
  id: "food-beverages",
@@ -1673,7 +1692,7 @@ var serviceAndExperience = [
1673
1692
  ]
1674
1693
  }
1675
1694
  ];
1676
- var availableCategories = [
1695
+ var availableCategories = assignColorToCategories([
1677
1696
  ...foodAndBeverages,
1678
1697
  ...handmadeAndLocalProducts,
1679
1698
  ...clothingAndFashion,
@@ -1684,19 +1703,7 @@ var availableCategories = [
1684
1703
  ...antiquesAndCollectibles,
1685
1704
  ...petProductsAndAnimalGoods,
1686
1705
  ...serviceAndExperience
1687
- ];
1688
- var categoryColors = {
1689
- "antiques-collectibles": "#8D6748",
1690
- "clothing-fashion": "#9D4EDD",
1691
- "electronics-technology": "#3AF3FF",
1692
- "food-beverages": "#FF0D1F",
1693
- "handmade-local-products": "#EE7E54",
1694
- "health-wellness": "#E23794",
1695
- "home-garden-household-goods": "#067325",
1696
- "pet-products-animal-goods": "#68E788",
1697
- "services-experiences": "#2E16A5",
1698
- "toys-childrens-items": "#FFF966"
1699
- };
1706
+ ]);
1700
1707
 
1701
1708
  // src/formFields/socialMedia.ts
1702
1709
  var socialMedia = [
@@ -3886,6 +3893,24 @@ var globalResourceSchema = yup.object().shape({
3886
3893
  region: yup.string().label("Region").required("Region is required"),
3887
3894
  socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
3888
3895
  });
3896
+ var categorySchema = yup.array().of(
3897
+ yup.object().shape({
3898
+ id: yup.string().required("Category id is required"),
3899
+ name: yup.string().required("Category name is required"),
3900
+ subcategories: yup.array().of(
3901
+ yup.object().shape({
3902
+ id: yup.string().defined(),
3903
+ items: yup.array().of(
3904
+ yup.object().shape({
3905
+ id: yup.string().defined(),
3906
+ name: yup.string().defined()
3907
+ })
3908
+ ).nullable(),
3909
+ name: yup.string().defined()
3910
+ })
3911
+ ).min(1, "At least one subcategory is required").required("Subcategories are required")
3912
+ })
3913
+ ).min(1, "Category list must contain at least one item").required("Categories are required");
3889
3914
 
3890
3915
  // src/yupSchema/market.ts
3891
3916
  import * as yup2 from "yup";
@@ -3945,24 +3970,7 @@ var marketInfoSchema = yup2.object().shape({
3945
3970
  // src/yupSchema/stallholder.ts
3946
3971
  import * as yup3 from "yup";
3947
3972
  var stallHolderSchema = globalResourceSchema.shape({
3948
- categories: yup3.array().of(
3949
- yup3.object().shape({
3950
- id: yup3.string().required("Category id is required"),
3951
- name: yup3.string().required("Category name is required"),
3952
- subcategories: yup3.array().of(
3953
- yup3.object().shape({
3954
- id: yup3.string().defined(),
3955
- items: yup3.array().of(
3956
- yup3.object().shape({
3957
- id: yup3.string().defined(),
3958
- name: yup3.string().defined()
3959
- })
3960
- ).nullable(),
3961
- name: yup3.string().defined()
3962
- })
3963
- ).min(1, "At least one subcategory is required").required("Subcategories are required")
3964
- })
3965
- ).min(1, "Category list must contain at least one item").required("Categories are required"),
3973
+ categories: categorySchema,
3966
3974
  multiLocation: yup3.boolean().required("Multi location is required"),
3967
3975
  products: yup3.array().of(yup3.string().defined()).min(1, "Product list must contain at least one item").required("Products are required")
3968
3976
  });
@@ -4087,15 +4095,15 @@ var defaultMarketFormValues = {
4087
4095
  ...globalDefaultValues,
4088
4096
  dateTime: [
4089
4097
  {
4090
- endDate: "04-07-2025",
4098
+ endDate: "04-09-2025",
4091
4099
  endTime: "15:00",
4092
- startDate: "04-07-2025",
4100
+ startDate: "04-09-2025",
4093
4101
  startTime: "09:00"
4094
4102
  },
4095
4103
  {
4096
- endDate: "05-07-2025",
4104
+ endDate: "05-09-2025",
4097
4105
  endTime: "15:00",
4098
- startDate: "05-07-2025",
4106
+ startDate: "05-09-2025",
4099
4107
  startTime: "09:00"
4100
4108
  }
4101
4109
  ],