@royaltics/ui 1.0.5 → 1.0.7

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 (212) hide show
  1. package/dist/buttons/Button.d.ts +14 -16
  2. package/dist/buttons/Button.d.ts.map +1 -1
  3. package/dist/buttons/Button.js +23 -8
  4. package/dist/buttons/Button.js.map +1 -1
  5. package/dist/buttons/Button.stories.d.ts +18 -0
  6. package/dist/buttons/Button.stories.d.ts.map +1 -0
  7. package/dist/buttons/Button.stories.js +41 -0
  8. package/dist/buttons/Button.stories.js.map +1 -0
  9. package/dist/buttons/LinkButton.d.ts +8 -0
  10. package/dist/buttons/LinkButton.d.ts.map +1 -0
  11. package/dist/buttons/LinkButton.js +9 -0
  12. package/dist/buttons/LinkButton.js.map +1 -0
  13. package/dist/buttons/LinkButton.stories.d.ts +7 -0
  14. package/dist/buttons/LinkButton.stories.d.ts.map +1 -0
  15. package/dist/buttons/LinkButton.stories.js +48 -0
  16. package/dist/buttons/LinkButton.stories.js.map +1 -0
  17. package/dist/buttons/index.d.ts +2 -1
  18. package/dist/buttons/index.d.ts.map +1 -1
  19. package/dist/buttons/index.js +1 -0
  20. package/dist/buttons/index.js.map +1 -1
  21. package/dist/components/CheckboxTree.d.ts +5 -0
  22. package/dist/components/CheckboxTree.d.ts.map +1 -0
  23. package/dist/components/CheckboxTree.js +126 -0
  24. package/dist/components/CheckboxTree.js.map +1 -0
  25. package/dist/components/CheckboxTree.stories.d.ts +18 -0
  26. package/dist/components/CheckboxTree.stories.d.ts.map +1 -0
  27. package/dist/components/CheckboxTree.stories.js +39 -0
  28. package/dist/components/CheckboxTree.stories.js.map +1 -0
  29. package/dist/components/ConfirmDialogModal.d.ts +14 -0
  30. package/dist/components/ConfirmDialogModal.d.ts.map +1 -0
  31. package/dist/components/ConfirmDialogModal.js +25 -0
  32. package/dist/components/ConfirmDialogModal.js.map +1 -0
  33. package/dist/components/ConfirmDialogModal.stories.d.ts +18 -0
  34. package/dist/components/ConfirmDialogModal.stories.d.ts.map +1 -0
  35. package/dist/components/ConfirmDialogModal.stories.js +39 -0
  36. package/dist/components/ConfirmDialogModal.stories.js.map +1 -0
  37. package/dist/components/GenericCard.d.ts +13 -0
  38. package/dist/components/GenericCard.d.ts.map +1 -0
  39. package/dist/components/GenericCard.js +14 -0
  40. package/dist/components/GenericCard.js.map +1 -0
  41. package/dist/components/GenericCard.stories.d.ts +17 -0
  42. package/dist/components/GenericCard.stories.d.ts.map +1 -0
  43. package/dist/components/GenericCard.stories.js +30 -0
  44. package/dist/components/GenericCard.stories.js.map +1 -0
  45. package/dist/components/Paginate.d.ts +22 -0
  46. package/dist/components/Paginate.d.ts.map +1 -0
  47. package/dist/components/Paginate.js +102 -0
  48. package/dist/components/Paginate.js.map +1 -0
  49. package/dist/components/Paginate.stories.d.ts +18 -0
  50. package/dist/components/Paginate.stories.d.ts.map +1 -0
  51. package/dist/components/Paginate.stories.js +40 -0
  52. package/dist/components/Paginate.stories.js.map +1 -0
  53. package/dist/components/PhotoCard.d.ts +12 -0
  54. package/dist/components/PhotoCard.d.ts.map +1 -0
  55. package/dist/components/PhotoCard.js +62 -0
  56. package/dist/components/PhotoCard.js.map +1 -0
  57. package/dist/components/PlayerYoutube.d.ts +17 -0
  58. package/dist/components/PlayerYoutube.d.ts.map +1 -0
  59. package/dist/components/PlayerYoutube.js +41 -0
  60. package/dist/components/PlayerYoutube.js.map +1 -0
  61. package/dist/components/checkboxtree/CheckBoxTreeButton.d.ts +8 -0
  62. package/dist/components/checkboxtree/CheckBoxTreeButton.d.ts.map +1 -0
  63. package/dist/components/checkboxtree/CheckBoxTreeButton.js +7 -0
  64. package/dist/components/checkboxtree/CheckBoxTreeButton.js.map +1 -0
  65. package/dist/components/checkboxtree/CheckboxTreeError.d.ts +5 -0
  66. package/dist/components/checkboxtree/CheckboxTreeError.d.ts.map +1 -0
  67. package/dist/components/checkboxtree/CheckboxTreeError.js +16 -0
  68. package/dist/components/checkboxtree/CheckboxTreeError.js.map +1 -0
  69. package/dist/components/checkboxtree/NativeCheckbox.d.ts +7 -0
  70. package/dist/components/checkboxtree/NativeCheckbox.d.ts.map +1 -0
  71. package/dist/components/checkboxtree/NativeCheckbox.js +17 -0
  72. package/dist/components/checkboxtree/NativeCheckbox.js.map +1 -0
  73. package/dist/components/checkboxtree/NodeModel.d.ts +30 -0
  74. package/dist/components/checkboxtree/NodeModel.d.ts.map +1 -0
  75. package/dist/components/checkboxtree/NodeModel.js +184 -0
  76. package/dist/components/checkboxtree/NodeModel.js.map +1 -0
  77. package/dist/components/checkboxtree/TreeNode.d.ts +44 -0
  78. package/dist/components/checkboxtree/TreeNode.d.ts.map +1 -0
  79. package/dist/components/checkboxtree/TreeNode.js +139 -0
  80. package/dist/components/checkboxtree/TreeNode.js.map +1 -0
  81. package/dist/components/checkboxtree/constants.d.ts +8 -0
  82. package/dist/components/checkboxtree/constants.d.ts.map +1 -0
  83. package/dist/components/checkboxtree/constants.js +46 -0
  84. package/dist/components/checkboxtree/constants.js.map +1 -0
  85. package/dist/components/checkboxtree/types/types.d.ts +70 -0
  86. package/dist/components/checkboxtree/types/types.d.ts.map +1 -0
  87. package/dist/components/checkboxtree/types/types.js +2 -0
  88. package/dist/components/checkboxtree/types/types.js.map +1 -0
  89. package/dist/components/checkboxtree/utils.d.ts +16 -0
  90. package/dist/components/checkboxtree/utils.d.ts.map +1 -0
  91. package/dist/components/checkboxtree/utils.js +28 -0
  92. package/dist/components/checkboxtree/utils.js.map +1 -0
  93. package/dist/components/index.d.ts +7 -0
  94. package/dist/components/index.d.ts.map +1 -0
  95. package/dist/components/index.js +9 -0
  96. package/dist/components/index.js.map +1 -0
  97. package/dist/constants/DataArrayNodes.d.ts +53 -0
  98. package/dist/constants/DataArrayNodes.d.ts.map +1 -0
  99. package/dist/constants/DataArrayNodes.js +162 -0
  100. package/dist/constants/DataArrayNodes.js.map +1 -0
  101. package/dist/constants/Variants.d.ts +26 -0
  102. package/dist/constants/Variants.d.ts.map +1 -0
  103. package/dist/constants/Variants.js +26 -0
  104. package/dist/constants/Variants.js.map +1 -0
  105. package/dist/forms/Button.d.ts +12 -0
  106. package/dist/forms/Button.d.ts.map +1 -0
  107. package/dist/forms/Button.js +28 -0
  108. package/dist/forms/Button.js.map +1 -0
  109. package/dist/forms/Button.stories.d.ts +18 -0
  110. package/dist/forms/Button.stories.d.ts.map +1 -0
  111. package/dist/forms/Button.stories.js +41 -0
  112. package/dist/forms/Button.stories.js.map +1 -0
  113. package/dist/forms/Checkbox.d.ts +13 -10
  114. package/dist/forms/Checkbox.d.ts.map +1 -1
  115. package/dist/forms/Checkbox.js +43 -4
  116. package/dist/forms/Checkbox.js.map +1 -1
  117. package/dist/forms/Checkbox.stories.d.ts +20 -0
  118. package/dist/forms/Checkbox.stories.d.ts.map +1 -0
  119. package/dist/forms/Checkbox.stories.js +65 -0
  120. package/dist/forms/Checkbox.stories.js.map +1 -0
  121. package/dist/forms/Input.d.ts +11 -22
  122. package/dist/forms/Input.d.ts.map +1 -1
  123. package/dist/forms/Input.js +27 -12
  124. package/dist/forms/Input.js.map +1 -1
  125. package/dist/forms/Input.stories.d.ts +22 -0
  126. package/dist/forms/Input.stories.d.ts.map +1 -0
  127. package/dist/forms/Input.stories.js +59 -0
  128. package/dist/forms/Input.stories.js.map +1 -0
  129. package/dist/forms/LinkButton.d.ts +8 -0
  130. package/dist/forms/LinkButton.d.ts.map +1 -0
  131. package/dist/forms/LinkButton.js +9 -0
  132. package/dist/forms/LinkButton.js.map +1 -0
  133. package/dist/forms/LinkButton.stories.d.ts +7 -0
  134. package/dist/forms/LinkButton.stories.d.ts.map +1 -0
  135. package/dist/forms/LinkButton.stories.js +48 -0
  136. package/dist/forms/LinkButton.stories.js.map +1 -0
  137. package/dist/forms/PhotoCard.d.ts.map +1 -1
  138. package/dist/forms/PlayerYoutube.d.ts.map +1 -1
  139. package/dist/forms/RadioButton.d.ts +2 -2
  140. package/dist/forms/RadioButton.d.ts.map +1 -1
  141. package/dist/forms/RadioButton.js +1 -1
  142. package/dist/forms/RadioButton.js.map +1 -1
  143. package/dist/forms/Select.d.ts +6 -14
  144. package/dist/forms/Select.d.ts.map +1 -1
  145. package/dist/forms/Select.js +25 -15
  146. package/dist/forms/Select.js.map +1 -1
  147. package/dist/forms/Select.stories.d.ts +17 -0
  148. package/dist/forms/Select.stories.d.ts.map +1 -0
  149. package/dist/forms/Select.stories.js +36 -0
  150. package/dist/forms/Select.stories.js.map +1 -0
  151. package/dist/forms/TextArea.d.ts +5 -13
  152. package/dist/forms/TextArea.d.ts.map +1 -1
  153. package/dist/forms/TextArea.js +4 -4
  154. package/dist/forms/TextArea.js.map +1 -1
  155. package/dist/forms/TextArea.stories.d.ts +17 -0
  156. package/dist/forms/TextArea.stories.d.ts.map +1 -0
  157. package/dist/forms/TextArea.stories.js +29 -0
  158. package/dist/forms/TextArea.stories.js.map +1 -0
  159. package/dist/forms/ToggleSwitch.d.ts.map +1 -1
  160. package/dist/forms/index.d.ts +4 -3
  161. package/dist/forms/index.d.ts.map +1 -1
  162. package/dist/forms/index.js +3 -9
  163. package/dist/forms/index.js.map +1 -1
  164. package/dist/hooks/useHttpState.d.ts.map +1 -1
  165. package/dist/hooks/useRouter.d.ts +2 -2
  166. package/dist/icons/index.d.ts +2 -0
  167. package/dist/icons/index.d.ts.map +1 -0
  168. package/dist/icons/index.js +3 -0
  169. package/dist/icons/index.js.map +1 -0
  170. package/dist/index.d.ts +2 -7
  171. package/dist/index.d.ts.map +1 -1
  172. package/dist/index.js +2 -12
  173. package/dist/index.js.map +1 -1
  174. package/dist/reducers/index.d.ts.map +1 -1
  175. package/dist/stories/Button.d.ts +17 -0
  176. package/dist/stories/Button.d.ts.map +1 -0
  177. package/dist/stories/Button.js +8 -0
  178. package/dist/stories/Button.js.map +1 -0
  179. package/dist/stories/Button.stories.d.ts +25 -0
  180. package/dist/stories/Button.stories.d.ts.map +1 -0
  181. package/dist/stories/Button.stories.js +51 -0
  182. package/dist/stories/Button.stories.js.map +1 -0
  183. package/dist/stories/Header.d.ts +14 -0
  184. package/dist/stories/Header.d.ts.map +1 -0
  185. package/dist/stories/Header.js +21 -0
  186. package/dist/stories/Header.js.map +1 -0
  187. package/dist/stories/Header.stories.d.ts +19 -0
  188. package/dist/stories/Header.stories.d.ts.map +1 -0
  189. package/dist/stories/Header.stories.js +27 -0
  190. package/dist/stories/Header.stories.js.map +1 -0
  191. package/dist/stories/Page.d.ts +4 -0
  192. package/dist/stories/Page.d.ts.map +1 -0
  193. package/dist/stories/Page.js +38 -0
  194. package/dist/stories/Page.js.map +1 -0
  195. package/dist/stories/Page.stories.d.ts +13 -0
  196. package/dist/stories/Page.stories.d.ts.map +1 -0
  197. package/dist/stories/Page.stories.js +25 -0
  198. package/dist/stories/Page.stories.js.map +1 -0
  199. package/dist/types/StoriesArguments.d.ts +4 -0
  200. package/dist/types/StoriesArguments.d.ts.map +1 -0
  201. package/dist/types/StoriesArguments.js +52 -0
  202. package/dist/types/StoriesArguments.js.map +1 -0
  203. package/dist/types/global.d.ts +31 -0
  204. package/dist/types/global.d.ts.map +1 -0
  205. package/dist/types/global.js +2 -0
  206. package/dist/types/global.js.map +1 -0
  207. package/dist/utils/cvmix.d.ts +23 -0
  208. package/dist/utils/cvmix.d.ts.map +1 -0
  209. package/dist/utils/cvmix.js +46 -0
  210. package/dist/utils/cvmix.js.map +1 -0
  211. package/dist/validators/index.d.ts.map +1 -1
  212. package/package.json +101 -75
@@ -0,0 +1,52 @@
1
+ export const ArgumentsComponents = {
2
+ size: {
3
+ control: { type: 'select' },
4
+ options: ['xs', 'sm', 'md', 'lg'],
5
+ description: 'Size Padding Component',
6
+ },
7
+ theme: {
8
+ control: { type: 'select' },
9
+ options: ['primary', 'secondary', 'accent', 'success', 'warn', 'danger'],
10
+ description: 'Theme Colors Banckground and Foreground for Components',
11
+ },
12
+ type: {
13
+ control: { type: 'select' },
14
+ options: ["text", 'time', "date", "number", "decimal", 'email', 'password', 'month', 'datetime-local',],
15
+ description: 'Theme Colors Banckground and Foreground for Components',
16
+ },
17
+ variant: {
18
+ control: { type: 'select' },
19
+ options: ['fill', 'outline'],
20
+ description: 'Style theme border and background components',
21
+ },
22
+ tabIndex: {
23
+ control: 'number',
24
+ description: 'Style theme border and background components',
25
+ },
26
+ width: {
27
+ control: { type: 'select' },
28
+ options: ['full', 'max'],
29
+ description: 'Style Width and Height COmponent',
30
+ },
31
+ loading: { control: 'boolean', description: 'Loading el botón' },
32
+ disabled: { control: 'boolean', description: 'Deshabilita el botón' },
33
+ readOnly: {
34
+ control: 'boolean',
35
+ description: 'No editable input',
36
+ },
37
+ };
38
+ export const ArgumentsBase = {
39
+ size: ArgumentsComponents.size,
40
+ theme: ArgumentsComponents.theme,
41
+ variant: ArgumentsComponents.variant,
42
+ width: ArgumentsComponents.width,
43
+ tabIndex: ArgumentsComponents.tabIndex,
44
+ };
45
+ export const ArgumentsInputs = {
46
+ size: ArgumentsComponents.size,
47
+ variant: ArgumentsComponents.variant,
48
+ width: ArgumentsComponents.width,
49
+ tabIndex: ArgumentsComponents.tabIndex,
50
+ readOnly: ArgumentsComponents.readOnly,
51
+ };
52
+ //# sourceMappingURL=StoriesArguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoriesArguments.js","sourceRoot":"","sources":["../../src/types/StoriesArguments.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC7C,IAAI,EAAE;QACF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,WAAW,EAAE,wBAAwB;KACxC;IACD,KAAK,EAAE;QACH,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC;QACxE,WAAW,EA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EAAE,mBAAmB,CAAC,KAAK;IAChC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IACtC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;CACzC,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { HtmlHTMLAttributes, LegacyRef } from "react";
2
+ export type SizeComponent = 'xs' | 'sm' | 'md' | 'lg';
3
+ export type ThemeComponent = 'primary' | 'secondary' | 'accent' | 'success' | 'warn' | 'danger';
4
+ export type VariantComponent = 'fill' | 'outline';
5
+ export interface ComponentBase {
6
+ theme?: ThemeComponent;
7
+ variant?: VariantComponent;
8
+ size?: SizeComponent;
9
+ width?: 'full' | 'max';
10
+ className?: string;
11
+ style?: HtmlHTMLAttributes<HTMLDivElement>["style"];
12
+ tabIndex?: number;
13
+ disabled?: boolean;
14
+ }
15
+ export interface ComponentInputBase {
16
+ id: string;
17
+ name?: string;
18
+ referer?: LegacyRef<any>;
19
+ lb?: string;
20
+ variant?: VariantComponent;
21
+ size?: SizeComponent;
22
+ width?: 'full' | 'max';
23
+ className?: string;
24
+ style?: HtmlHTMLAttributes<HTMLDivElement>["style"];
25
+ tabIndex?: number;
26
+ readOnly?: boolean;
27
+ required?: boolean;
28
+ placeholder?: string;
29
+ error?: boolean;
30
+ }
31
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAChG,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;AAGlD,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ export { default as cn } from 'classnames';
2
+ type BaseVariantConfig = Record<string, string>;
3
+ type NestedVariantLevel = {
4
+ __base?: string;
5
+ [key: string]: string | Record<string, string> | undefined;
6
+ };
7
+ type NestedVariantConfig = {
8
+ __key: string;
9
+ __base?: string;
10
+ [key: string]: NestedVariantLevel | string | undefined;
11
+ };
12
+ type CvaMixConfig<T extends Record<string, any>> = {
13
+ [K in keyof T]?: BaseVariantConfig | NestedVariantConfig;
14
+ };
15
+ type DefaultProps<T extends Record<string, any>> = {
16
+ [K in keyof T]?: string;
17
+ } & {
18
+ [key: string]: string;
19
+ };
20
+ export declare function cvaMix<T extends Record<string, any>>(baseClasses: string, config: CvaMixConfig<T>, defaultOptions?: DefaultProps<T>): (mainProps: { [K in keyof T]?: string; }, keyProps?: {
21
+ [key: string]: string;
22
+ }) => string;
23
+ //# sourceMappingURL=cvmix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cvmix.d.ts","sourceRoot":"","sources":["../../src/utils/cvmix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAG3C,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhD,KAAK,kBAAkB,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC9D,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1D,CAAC;AAGF,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KAC9C,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,iBAAiB,GAAG,mBAAmB;CAC3D,CAAC;AAGF,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KAC9C,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAC1B,GAAG;IACA,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChD,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,cAAc,GAAE,YAAY,CAAC,CAAC,CAAM,IAIhC,WAAW,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,EACtC,WAAU;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,KACzC,MAAM,CA8CZ"}
@@ -0,0 +1,46 @@
1
+ import clsx from 'clsx'; // Asegúrate de tener clsx instalado: npm install clsx
2
+ export { default as cn } from 'classnames';
3
+ export function cvaMix(baseClasses, config, defaultOptions = {}) {
4
+ // La función principal que se retorna para aplicar las variantes
5
+ return (mainProps, keyProps = {}) => {
6
+ let classes = [baseClasses];
7
+ // Iterar sobre las propiedades principales para aplicar las variantes
8
+ for (const propKey in config) {
9
+ if (Object.prototype.hasOwnProperty.call(config, propKey)) {
10
+ const variantConfig = config[propKey];
11
+ const propValue = mainProps[propKey] || defaultOptions[propKey]; // Valor actual de la prop o valor por defecto
12
+ if (typeof variantConfig === 'object' && !('__key' in variantConfig)) {
13
+ // Es una variante base (ej., 'size')
14
+ if (propValue && variantConfig[propValue]) {
15
+ classes.push(variantConfig[propValue]);
16
+ }
17
+ }
18
+ else if (typeof variantConfig === 'object' && '__key' in variantConfig) {
19
+ // Es una variante anidada (ej., 'variant')
20
+ const nestedConfig = variantConfig;
21
+ const nestedPropKey = nestedConfig.__key; // Ej., 'theme'
22
+ // Aplicar la base de la variante principal si existe
23
+ if (nestedConfig.__base) {
24
+ classes.push(nestedConfig.__base);
25
+ }
26
+ // Verificar si el valor de la prop principal coincide con una de las variantes anidadas (ej., 'filled', 'outline')
27
+ if (propValue && typeof nestedConfig[propValue] === 'object') {
28
+ const currentNestedLevel = nestedConfig[propValue];
29
+ const nestedPropValue = keyProps[nestedPropKey] || defaultOptions[nestedPropKey];
30
+ // Aplicar la base del nivel anidado (ej., '__base' de 'filled' o 'outline')
31
+ if (currentNestedLevel.__base) {
32
+ classes.push(currentNestedLevel.__base);
33
+ }
34
+ // Aplicar la clase específica del nivel más profundo (ej., 'primary' de 'filled')
35
+ if (nestedPropValue && currentNestedLevel[nestedPropValue]) {
36
+ classes.push(currentNestedLevel[nestedPropValue]);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ // Retorna la cadena de clases combinada por clsx
43
+ return clsx(...classes);
44
+ };
45
+ }
46
+ //# sourceMappingURL=cvmix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cvmix.js","sourceRoot":"","sources":["../../src/utils/cvmix.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC,CAAC,sDAAsD;AAC/E,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AA4B3C,MAAM,UAAU,MAAM,CAClB,WAAmB,EACnB,MAAuB,EACvB,iBAAkC,EAAE;IAEpC,iEAAiE;IACjE,OAAO,CACH,SAAsC,EACtC,WAAsC,EAAE,EAClC,EAAE;QACR,IAAI,OAAO,GAA2B,CAAC,WAAW,CAAC,CAAC;QAEpD,sEAAsE;QACtE,KAAK,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;gBACxD,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,8CAA8C;gBAE/G,I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CAAC;IAC5B,CAAC,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,SAAU,GAAG,cAAa,MAAM,YAGnD,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,OAEzC,CAAA;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAEjC;AAED,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,OAItC,CAAC;AAGF,eAAO,MAAM,gBAAgB,eAAgB,MAAM,YAIlD,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,OAGvC,CAAA;AAED,eAAO,MAAM,KAAK,UAAW,MAAM,KAAG,OAGrC,CAAA;AAGD,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,CAAC;AACtI,KAAK,KAAK,GAAG;IACT,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,GAAG,MAAM,CAAA;KAAE,CAAA;CACnH,CAAA;AAOD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,WAAY,GAAG,eAAe,KAAK,UAAU,GAAG,KAAG,OAyF1E,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,EAAE,YAAW,MAAU,YAGvD,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAEzC,CAAA;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAEjC;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,KAAG,OAItC,CAAC;AAGF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,YAIlD,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,OAGvC,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,OAGrC,CAAA;AAGD,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,CAAC;AACtI,KAAK,KAAK,GAAG;IACT,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,GAAG,MAAM,CAAA;KAAE,CAAA;CACnH,CAAA;AAOD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,GAAG,EAAE,aAAa,KAAK,EAAE,QAAQ,GAAG,KAAG,OAyF1E,CAAA"}
package/package.json CHANGED
@@ -1,75 +1,101 @@
1
- {
2
- "name": "@royaltics/ui",
3
- "version": "1.0.5",
4
- "private": false,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "type": "module",
9
- "files": [
10
- "dist"
11
- ],
12
- "exports": {
13
- ".": {
14
- "import": "./dist/index.js",
15
- "require": "./dist/index.cjs"
16
- },
17
- "./buttons": {
18
- "import": "./dist/buttons/index.js",
19
- "require": "./dist/buttons/index.cjs",
20
- "types": "./dist/buttons/index.d.ts"
21
- },
22
- "./forms": {
23
- "import": "./dist/forms/index.js",
24
- "require": "./dist/forms/index.cjs",
25
- "types": "./dist/forms/index.d.ts"
26
- },
27
- "./hooks": {
28
- "import": "./dist/hooks/index.js",
29
- "require": "./dist/hooks/index.cjs",
30
- "types": "./dist/hooks/index.d.ts"
31
- },
32
- "./reducers": {
33
- "import": "./dist/reducers/index.js",
34
- "require": "./dist/reducers/index.cjs",
35
- "types": "./dist/reducers/index.d.ts"
36
- },
37
- "./cards": {
38
- "import": "./dist/cards/index.js",
39
- "require": "./dist/cards/index.cjs",
40
- "types": "./dist/cards/index.d.ts"
41
- },
42
- "./validators": {
43
- "import": "./dist/validators/index.js",
44
- "require": "./dist/validators/index.cjs",
45
- "types": "./dist/validators/index.d.ts"
46
- }
47
- },
48
- "scripts": {
49
- "build:ext": "tsc && node fix-extensions.js",
50
- "build": "tsc && tsc-alias",
51
- "builds": "tsc && pnpm build:cjs && pnpm build:esm",
52
- "build:cjs": "tsc --module CommonJS --outDir dist/cjs",
53
- "build:esm": "tsc --module ESNext --outDir dist/esm",
54
- "prepublishOnly": "npm run build"
55
- },
56
- "peerDependencies": {
57
- "react": "^18 || ^19",
58
- "react-dom": "^18 || ^19",
59
- "react-router-dom": "^7.6.3"
60
- },
61
- "devDependencies": {
62
- "@types/react": "^18.0.0",
63
- "@types/react-dom": "^18.0.0",
64
- "@types/youtube": "^0.1.0",
65
- "tsc-alias": "^1.8.10",
66
- "tsup": "^7.0.0",
67
- "typescript": "^5.0.0"
68
- },
69
- "dependencies": {
70
- "@heroicons/react": "^2.2.0",
71
- "classnames": "^2.5.1",
72
- "query-string": "^9.1.1",
73
- "react-toastify": "^11.0.3"
74
- }
75
- }
1
+ {
2
+ "name": "@royaltics/ui",
3
+ "version": "1.0.7",
4
+ "private": false,
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.cjs"
16
+ },
17
+ "./buttons": {
18
+ "import": "./dist/buttons/index.js",
19
+ "require": "./dist/buttons/index.cjs",
20
+ "types": "./dist/buttons/index.d.ts"
21
+ },
22
+ "./icons": {
23
+ "import": "./dist/icons/index.js",
24
+ "require": "./dist/icons/index.cjs",
25
+ "types": "./dist/icons/index.d.ts"
26
+ },
27
+ "./forms": {
28
+ "import": "./dist/forms/index.js",
29
+ "require": "./dist/forms/index.cjs",
30
+ "types": "./dist/forms/index.d.ts"
31
+ },
32
+ "./hooks": {
33
+ "import": "./dist/hooks/index.js",
34
+ "require": "./dist/hooks/index.cjs",
35
+ "types": "./dist/hooks/index.d.ts"
36
+ },
37
+ "./reducers": {
38
+ "import": "./dist/reducers/index.js",
39
+ "require": "./dist/reducers/index.cjs",
40
+ "types": "./dist/reducers/index.d.ts"
41
+ },
42
+ "./cards": {
43
+ "import": "./dist/cards/index.js",
44
+ "require": "./dist/cards/index.cjs",
45
+ "types": "./dist/cards/index.d.ts"
46
+ },
47
+ "./validators": {
48
+ "import": "./dist/validators/index.js",
49
+ "require": "./dist/validators/index.cjs",
50
+ "types": "./dist/validators/index.d.ts"
51
+ }
52
+ },
53
+ "scripts": {
54
+ "build:ext": "tsc && node fix-extensions.js",
55
+ "build": "tsc && tsc-alias",
56
+ "builds": "tsc && pnpm build:cjs && pnpm build:esm",
57
+ "build:cjs": "tsc --module CommonJS --outDir dist/cjs",
58
+ "build:esm": "tsc --module ESNext --outDir dist/esm",
59
+ "prepublishOnly": "npm run build",
60
+ "storybook": "storybook dev -p 6006",
61
+ "build-storybook": "storybook build"
62
+ },
63
+ "peerDependencies": {
64
+ "react": "^18 || ^19",
65
+ "react-dom": "^18 || ^19",
66
+ "react-router-dom": "^6 || ^7",
67
+ "tailwindcss": "^4"
68
+ },
69
+ "devDependencies": {
70
+ "@storybook/addon-docs": "9.0.16",
71
+ "@storybook/addon-onboarding": "9.0.16",
72
+ "@storybook/addon-postcss": "^2.0.0",
73
+ "@storybook/addon-themes": "^9.0.16",
74
+ "@storybook/react-vite": "9.0.16",
75
+ "@types/lodash.isequal": "^4.5.8",
76
+ "@types/node": "^24.0.12",
77
+ "@types/react": "^18.0.0",
78
+ "@types/react-dom": "^18.0.0",
79
+ "@types/youtube": "^0.1.0",
80
+ "postcss": "^8.5.6",
81
+ "react": "^19.1.0",
82
+ "react-dom": "19.1.0",
83
+ "react-router-dom": "^7.6.3",
84
+ "storybook": "9.0.16",
85
+ "tailwindcss": "^4.1.11",
86
+ "tsc-alias": "^1.8.16",
87
+ "tsup": "^8.5.0",
88
+ "typescript": "^5.8.3"
89
+ },
90
+ "dependencies": {
91
+ "@heroicons/react": "^2.2.0",
92
+ "@tailwindcss/postcss": "^4.1.11",
93
+ "classnames": "^2.5.1",
94
+ "lodash.isequal": "^4.5.0",
95
+ "memoize": "^10.1.0",
96
+ "memoize-one": "^6.0.0",
97
+ "query-string": "^9.1.1",
98
+ "react-toastify": "^11.0.3",
99
+ "uuid": "^11.1.0"
100
+ }
101
+ }