@komarcalabs/design-system 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +409 -0
  2. package/dist/carousel-D_f-K2v2.js +83 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +51 -0
  6. package/dist/plugin-DfFKi2ZR.js +941 -0
  7. package/dist/react/components/KmAlert.d.ts +8 -0
  8. package/dist/react/components/KmAlert.d.ts.map +1 -0
  9. package/dist/react/components/KmBadge.d.ts +7 -0
  10. package/dist/react/components/KmBadge.d.ts.map +1 -0
  11. package/dist/react/components/KmButton.d.ts +18 -0
  12. package/dist/react/components/KmButton.d.ts.map +1 -0
  13. package/dist/react/components/KmCard.d.ts +7 -0
  14. package/dist/react/components/KmCard.d.ts.map +1 -0
  15. package/dist/react/components/KmInput.d.ts +14 -0
  16. package/dist/react/components/KmInput.d.ts.map +1 -0
  17. package/dist/react/components/KmSelect.d.ts +23 -0
  18. package/dist/react/components/KmSelect.d.ts.map +1 -0
  19. package/dist/react/components/KmStack.d.ts +13 -0
  20. package/dist/react/components/KmStack.d.ts.map +1 -0
  21. package/dist/react/components/KmStepper.d.ts +17 -0
  22. package/dist/react/components/KmStepper.d.ts.map +1 -0
  23. package/dist/react/components/KmTextarea.d.ts +14 -0
  24. package/dist/react/components/KmTextarea.d.ts.map +1 -0
  25. package/dist/react/components/KmToggleSwitch.d.ts +11 -0
  26. package/dist/react/components/KmToggleSwitch.d.ts.map +1 -0
  27. package/dist/react/components/index.d.ts +11 -0
  28. package/dist/react/components/index.d.ts.map +1 -0
  29. package/dist/react/index.d.ts +2 -0
  30. package/dist/react/index.d.ts.map +1 -0
  31. package/dist/react.d.ts +2 -0
  32. package/dist/react.d.ts.map +1 -0
  33. package/dist/react.js +363 -0
  34. package/dist/styles.css +1 -0
  35. package/dist/theme-CI9qhP-e.js +337 -0
  36. package/dist/toggleSwitch-CpBXc_jq.js +369 -0
  37. package/dist/tokens/colors.d.ts +284 -0
  38. package/dist/tokens/colors.d.ts.map +1 -0
  39. package/dist/tokens/index.d.ts +5 -0
  40. package/dist/tokens/index.d.ts.map +1 -0
  41. package/dist/tokens/spacing.d.ts +31 -0
  42. package/dist/tokens/spacing.d.ts.map +1 -0
  43. package/dist/tokens/theme.d.ts +96 -0
  44. package/dist/tokens/theme.d.ts.map +1 -0
  45. package/dist/tokens/typography.d.ts +22 -0
  46. package/dist/tokens/typography.d.ts.map +1 -0
  47. package/dist/tokens.d.ts +3 -0
  48. package/dist/tokens.d.ts.map +1 -0
  49. package/dist/tokens.js +31 -0
  50. package/dist/utils/classNames.d.ts +3 -0
  51. package/dist/utils/classNames.d.ts.map +1 -0
  52. package/dist/utils/index.d.ts +3 -0
  53. package/dist/utils/index.d.ts.map +1 -0
  54. package/dist/utils/useId.d.ts +9 -0
  55. package/dist/utils/useId.d.ts.map +1 -0
  56. package/dist/variants/alert.d.ts +85 -0
  57. package/dist/variants/alert.d.ts.map +1 -0
  58. package/dist/variants/avatar.d.ts +37 -0
  59. package/dist/variants/avatar.d.ts.map +1 -0
  60. package/dist/variants/badge.d.ts +46 -0
  61. package/dist/variants/badge.d.ts.map +1 -0
  62. package/dist/variants/button.d.ts +108 -0
  63. package/dist/variants/button.d.ts.map +1 -0
  64. package/dist/variants/card.d.ts +46 -0
  65. package/dist/variants/card.d.ts.map +1 -0
  66. package/dist/variants/carousel.d.ts +40 -0
  67. package/dist/variants/carousel.d.ts.map +1 -0
  68. package/dist/variants/field.d.ts +46 -0
  69. package/dist/variants/field.d.ts.map +1 -0
  70. package/dist/variants/index.d.ts +15 -0
  71. package/dist/variants/index.d.ts.map +1 -0
  72. package/dist/variants/input.d.ts +4 -0
  73. package/dist/variants/input.d.ts.map +1 -0
  74. package/dist/variants/select.d.ts +4 -0
  75. package/dist/variants/select.d.ts.map +1 -0
  76. package/dist/variants/spinner.d.ts +40 -0
  77. package/dist/variants/spinner.d.ts.map +1 -0
  78. package/dist/variants/stack.d.ts +91 -0
  79. package/dist/variants/stack.d.ts.map +1 -0
  80. package/dist/variants/stepper.d.ts +160 -0
  81. package/dist/variants/stepper.d.ts.map +1 -0
  82. package/dist/variants/textarea.d.ts +4 -0
  83. package/dist/variants/textarea.d.ts.map +1 -0
  84. package/dist/variants/toggleSwitch.d.ts +115 -0
  85. package/dist/variants/toggleSwitch.d.ts.map +1 -0
  86. package/dist/vue/components/KmAlert.vue.d.ts +26 -0
  87. package/dist/vue/components/KmAlert.vue.d.ts.map +1 -0
  88. package/dist/vue/components/KmAvatar.vue.d.ts +12 -0
  89. package/dist/vue/components/KmAvatar.vue.d.ts.map +1 -0
  90. package/dist/vue/components/KmBadge.vue.d.ts +24 -0
  91. package/dist/vue/components/KmBadge.vue.d.ts.map +1 -0
  92. package/dist/vue/components/KmButton.vue.d.ts +35 -0
  93. package/dist/vue/components/KmButton.vue.d.ts.map +1 -0
  94. package/dist/vue/components/KmCard.vue.d.ts +20 -0
  95. package/dist/vue/components/KmCard.vue.d.ts.map +1 -0
  96. package/dist/vue/components/KmCarousel.vue.d.ts +29 -0
  97. package/dist/vue/components/KmCarousel.vue.d.ts.map +1 -0
  98. package/dist/vue/components/KmDialog/KmDialog.vue.d.ts +30 -0
  99. package/dist/vue/components/KmDialog/KmDialog.vue.d.ts.map +1 -0
  100. package/dist/vue/components/KmDialog/KmDialogBody.vue.d.ts +18 -0
  101. package/dist/vue/components/KmDialog/KmDialogBody.vue.d.ts.map +1 -0
  102. package/dist/vue/components/KmDialog/KmDialogFooter.vue.d.ts +22 -0
  103. package/dist/vue/components/KmDialog/KmDialogFooter.vue.d.ts.map +1 -0
  104. package/dist/vue/components/KmDialog/KmDialogHeader.vue.d.ts +12 -0
  105. package/dist/vue/components/KmDialog/KmDialogHeader.vue.d.ts.map +1 -0
  106. package/dist/vue/components/KmDialog/index.d.ts +7 -0
  107. package/dist/vue/components/KmDialog/index.d.ts.map +1 -0
  108. package/dist/vue/components/KmInput.vue.d.ts +20 -0
  109. package/dist/vue/components/KmInput.vue.d.ts.map +1 -0
  110. package/dist/vue/components/KmSelect.vue.d.ts +29 -0
  111. package/dist/vue/components/KmSelect.vue.d.ts.map +1 -0
  112. package/dist/vue/components/KmSpinner.vue.d.ts +11 -0
  113. package/dist/vue/components/KmSpinner.vue.d.ts.map +1 -0
  114. package/dist/vue/components/KmStack.vue.d.ts +34 -0
  115. package/dist/vue/components/KmStack.vue.d.ts.map +1 -0
  116. package/dist/vue/components/KmStepper.vue.d.ts +22 -0
  117. package/dist/vue/components/KmStepper.vue.d.ts.map +1 -0
  118. package/dist/vue/components/KmTextarea.vue.d.ts +20 -0
  119. package/dist/vue/components/KmTextarea.vue.d.ts.map +1 -0
  120. package/dist/vue/components/KmToggleSwitch.vue.d.ts +20 -0
  121. package/dist/vue/components/KmToggleSwitch.vue.d.ts.map +1 -0
  122. package/dist/vue/components/index.d.ts +15 -0
  123. package/dist/vue/components/index.d.ts.map +1 -0
  124. package/dist/vue/index.d.ts +3 -0
  125. package/dist/vue/index.d.ts.map +1 -0
  126. package/dist/vue/plugin.d.ts +3 -0
  127. package/dist/vue/plugin.d.ts.map +1 -0
  128. package/dist/vue.d.ts +2 -0
  129. package/dist/vue.d.ts.map +1 -0
  130. package/dist/vue.js +22 -0
  131. package/package.json +86 -0
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { AlertVariants } from '../../variants';
3
+ export type KmAlertProps = HTMLAttributes<HTMLDivElement> & {
4
+ tone?: AlertVariants["tone"];
5
+ title?: ReactNode;
6
+ };
7
+ export declare function KmAlert({ tone, title, children, className, ...props }: KmAlertProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=KmAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmAlert.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGnE,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,IAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAS/F"}
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { BadgeVariants } from '../../variants';
3
+ export type KmBadgeProps = HTMLAttributes<HTMLSpanElement> & {
4
+ tone?: BadgeVariants["tone"];
5
+ };
6
+ export declare function KmBadge({ tone, className, ...props }: KmBadgeProps): import("react").JSX.Element;
7
+ //# sourceMappingURL=KmBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmBadge.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IAC3D,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAE9E"}
@@ -0,0 +1,18 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import { ButtonVariants } from '../../variants';
3
+ type CommonProps = {
4
+ children?: ReactNode;
5
+ variant?: ButtonVariants["variant"];
6
+ size?: ButtonVariants["size"];
7
+ loading?: boolean;
8
+ };
9
+ type ButtonProps = CommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
10
+ as?: "button";
11
+ };
12
+ type AnchorProps = CommonProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
13
+ as: "a";
14
+ };
15
+ export type KmButtonProps = ButtonProps | AnchorProps;
16
+ export declare function KmButton(props: KmButtonProps): import("react").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=KmButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmButton.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErE,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG,WAAW,GAC5B,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf,CAAC;AAEJ,KAAK,WAAW,GAAG,WAAW,GAC5B,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,EAAE,EAAE,GAAG,CAAC;CACT,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;AAEtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAgD5C"}
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type KmCardProps = HTMLAttributes<HTMLElement> & {
3
+ header?: ReactNode;
4
+ footer?: ReactNode;
5
+ };
6
+ export declare function KmCard({ header, footer, children, className, ...props }: KmCardProps): import("react").JSX.Element;
7
+ //# sourceMappingURL=KmCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BAUpF"}
@@ -0,0 +1,14 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export type KmInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "id"> & {
3
+ id?: string;
4
+ label?: string;
5
+ hint?: string;
6
+ error?: string;
7
+ };
8
+ export declare const KmInput: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "id"> & {
9
+ id?: string;
10
+ label?: string;
11
+ hint?: string;
12
+ error?: string;
13
+ } & import('react').RefAttributes<HTMLInputElement>>;
14
+ //# sourceMappingURL=KmInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmInput.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAS,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,OAAO;SANb,MAAM;YACH,MAAM;WACP,MAAM;YACL,MAAM;oDAkCd,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { SelectHTMLAttributes } from 'react';
2
+ export type KmSelectOption = {
3
+ label: string;
4
+ value: string | number;
5
+ disabled?: boolean;
6
+ };
7
+ export type KmSelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> & {
8
+ id?: string;
9
+ label?: string;
10
+ hint?: string;
11
+ error?: string;
12
+ placeholder?: string;
13
+ options: KmSelectOption[];
14
+ };
15
+ export declare const KmSelect: import('react').ForwardRefExoticComponent<Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> & {
16
+ id?: string;
17
+ label?: string;
18
+ hint?: string;
19
+ error?: string;
20
+ placeholder?: string;
21
+ options: KmSelectOption[];
22
+ } & import('react').RefAttributes<HTMLSelectElement>>;
23
+ //# sourceMappingURL=KmSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmSelect.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAS,MAAM,OAAO,CAAC;AAIrE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACtF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,QAAQ;SARd,MAAM;YACH,MAAM;WACP,MAAM;YACL,MAAM;kBACA,MAAM;aACX,cAAc,EAAE;qDA6CzB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ElementType, HTMLAttributes, ReactNode } from 'react';
2
+ import { StackVariants } from '../../variants';
3
+ export type KmStackProps = HTMLAttributes<HTMLElement> & {
4
+ as?: ElementType;
5
+ children?: ReactNode;
6
+ direction?: StackVariants["direction"];
7
+ gap?: StackVariants["gap"];
8
+ align?: StackVariants["align"];
9
+ justify?: StackVariants["justify"];
10
+ wrap?: StackVariants["wrap"];
11
+ };
12
+ export declare function KmStack({ as: Component, children, className, direction, gap, align, justify, wrap, ...props }: KmStackProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=KmStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmStack.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGnE,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACvD,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,EAAE,EAAE,SAAiB,EACrB,QAAQ,EACR,SAAS,EACT,SAAoB,EACpB,GAAU,EACV,KAAiB,EACjB,OAAiB,EACjB,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,YAAY,+BASd"}
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ interface Step {
3
+ title: string;
4
+ description?: string;
5
+ }
6
+ export interface KmStepperProps {
7
+ steps: Step[];
8
+ currentStep: number;
9
+ orientation?: "vertical" | "horizontal";
10
+ mode?: "desktop" | "mobile" | "auto";
11
+ mobileLayout?: "circular" | "horizontal";
12
+ mobileLabel?: string;
13
+ className?: string;
14
+ }
15
+ export declare const KmStepper: React.FC<KmStepperProps>;
16
+ export {};
17
+ //# sourceMappingURL=KmStepper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmStepper.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAG5D,UAAU,IAAI;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiO9C,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TextareaHTMLAttributes } from 'react';
2
+ export type KmTextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
3
+ id?: string;
4
+ label?: string;
5
+ hint?: string;
6
+ error?: string;
7
+ };
8
+ export declare const KmTextarea: import('react').ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & {
9
+ id?: string;
10
+ label?: string;
11
+ hint?: string;
12
+ error?: string;
13
+ } & import('react').RefAttributes<HTMLTextAreaElement>>;
14
+ //# sourceMappingURL=KmTextarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmTextarea.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmTextarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,sBAAsB,EAAS,MAAM,OAAO,CAAC;AAIvE,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,GAAG;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU;SANhB,MAAM;YACH,MAAM;WACP,MAAM;YACL,MAAM;uDAkCd,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface KmToggleSwitchProps {
3
+ isChecked?: boolean;
4
+ onChange?: (checked: boolean) => void;
5
+ label?: string;
6
+ size?: "small" | "medium" | "large";
7
+ disabled?: boolean;
8
+ className?: string;
9
+ }
10
+ export declare const KmToggleSwitch: React.FC<KmToggleSwitchProps>;
11
+ //# sourceMappingURL=KmToggleSwitch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KmToggleSwitch.d.ts","sourceRoot":"","sources":["../../../src/react/components/KmToggleSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsDxD,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from './KmAlert';
2
+ export * from './KmBadge';
3
+ export * from './KmButton';
4
+ export * from './KmCard';
5
+ export * from './KmInput';
6
+ export * from './KmSelect';
7
+ export * from './KmStack';
8
+ export * from './KmTextarea';
9
+ export * from './KmStepper';
10
+ export * from './KmToggleSwitch';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './react/index';
2
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,cAAc,eAAe,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,363 @@
1
+ /* empty css */
2
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
+ import { a as H, b as j, c as W, d as A, f as I, i as D, s as S, e as P, t as F, g as w, h as q } from "./toggleSwitch-CpBXc_jq.js";
4
+ import { forwardRef as K, useId as V, useState as B, useEffect as E, useMemo as M } from "react";
5
+ function k(...a) {
6
+ return a.filter(Boolean).join(" ");
7
+ }
8
+ function Z({ tone: a = "neutral", title: t, children: l, className: i, ...s }) {
9
+ const n = H({ tone: a });
10
+ return /* @__PURE__ */ c("div", { className: k(n.root(), i), role: "status", ...s, children: [
11
+ t ? /* @__PURE__ */ e("div", { className: n.title(), children: t }) : null,
12
+ /* @__PURE__ */ e("div", { className: n.description(), children: l })
13
+ ] });
14
+ }
15
+ function J({ tone: a = "neutral", className: t, ...l }) {
16
+ return /* @__PURE__ */ e("span", { className: k(j({ tone: a }), t), ...l });
17
+ }
18
+ function Q(a) {
19
+ const { as: t = "button", className: l, variant: i = "solid", size: s = "md", loading: n, children: m, ...f } = a, h = k(W({ variant: i, size: s, loading: n }), l);
20
+ if (t === "a")
21
+ return /* @__PURE__ */ e("a", { className: h, ...f, children: m });
22
+ const r = f;
23
+ return /* @__PURE__ */ c(
24
+ "button",
25
+ {
26
+ className: h,
27
+ type: "button",
28
+ disabled: r.disabled || n,
29
+ "aria-busy": n ? "true" : void 0,
30
+ ...r,
31
+ children: [
32
+ n && /* @__PURE__ */ c(
33
+ "svg",
34
+ {
35
+ className: "animate-spin h-4 w-4 mr-2 inline",
36
+ viewBox: "0 0 24 24",
37
+ fill: "none",
38
+ xmlns: "http://www.w3.org/2000/svg",
39
+ children: [
40
+ /* @__PURE__ */ e(
41
+ "circle",
42
+ {
43
+ className: "opacity-25",
44
+ cx: "12",
45
+ cy: "12",
46
+ r: "10",
47
+ stroke: "currentColor",
48
+ strokeWidth: "4"
49
+ }
50
+ ),
51
+ /* @__PURE__ */ e(
52
+ "path",
53
+ {
54
+ className: "opacity-75",
55
+ fill: "currentColor",
56
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ ),
62
+ m
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ function X({ header: a, footer: t, children: l, className: i, ...s }) {
68
+ const n = A();
69
+ return /* @__PURE__ */ c("section", { className: k(n.root(), i), ...s, children: [
70
+ a ? /* @__PURE__ */ e("header", { className: n.header(), children: a }) : null,
71
+ /* @__PURE__ */ e("div", { className: n.body(), children: l }),
72
+ t ? /* @__PURE__ */ e("footer", { className: n.footer(), children: t }) : null
73
+ ] });
74
+ }
75
+ const Y = K(function({ id: t, label: l, hint: i, error: s, className: n, ...m }, f) {
76
+ const h = V(), r = t || h, u = s ? `${r}-error` : i ? `${r}-hint` : void 0, d = I();
77
+ return /* @__PURE__ */ c("label", { className: d.root(), htmlFor: r, children: [
78
+ l ? /* @__PURE__ */ e("span", { className: d.label(), children: l }) : null,
79
+ /* @__PURE__ */ e(
80
+ "input",
81
+ {
82
+ ref: f,
83
+ id: r,
84
+ className: k(D(), n),
85
+ "aria-invalid": s ? "true" : void 0,
86
+ "aria-describedby": u,
87
+ ...m
88
+ }
89
+ ),
90
+ s ? /* @__PURE__ */ e("span", { id: `${r}-error`, className: d.error(), children: s }) : i ? /* @__PURE__ */ e("span", { id: `${r}-hint`, className: d.hint(), children: i }) : null
91
+ ] });
92
+ }), ee = K(function({ id: t, label: l, hint: i, error: s, placeholder: n, options: m, className: f, ...h }, r) {
93
+ const u = V(), d = t || u, x = s ? `${d}-error` : i ? `${d}-hint` : void 0, b = I();
94
+ return /* @__PURE__ */ c("label", { className: b.root(), htmlFor: d, children: [
95
+ l ? /* @__PURE__ */ e("span", { className: b.label(), children: l }) : null,
96
+ /* @__PURE__ */ c(
97
+ "select",
98
+ {
99
+ ref: r,
100
+ id: d,
101
+ className: k(S(), f),
102
+ "aria-invalid": s ? "true" : void 0,
103
+ "aria-describedby": x,
104
+ ...h,
105
+ children: [
106
+ n ? /* @__PURE__ */ e("option", { value: "", disabled: !0, children: n }) : null,
107
+ m.map((g) => /* @__PURE__ */ e("option", { value: g.value, disabled: g.disabled, children: g.label }, String(g.value)))
108
+ ]
109
+ }
110
+ ),
111
+ s ? /* @__PURE__ */ e("span", { id: `${d}-error`, className: b.error(), children: s }) : i ? /* @__PURE__ */ e("span", { id: `${d}-hint`, className: b.hint(), children: i }) : null
112
+ ] });
113
+ });
114
+ function ae({
115
+ as: a = "div",
116
+ children: t,
117
+ className: l,
118
+ direction: i = "column",
119
+ gap: s = "md",
120
+ align: n = "stretch",
121
+ justify: m = "start",
122
+ wrap: f = !1,
123
+ ...h
124
+ }) {
125
+ return /* @__PURE__ */ e(
126
+ a,
127
+ {
128
+ className: k(P({ direction: i, gap: s, align: n, justify: m, wrap: f }), l),
129
+ ...h,
130
+ children: t
131
+ }
132
+ );
133
+ }
134
+ const te = K(function({ id: t, label: l, hint: i, error: s, className: n, ...m }, f) {
135
+ const h = V(), r = t || h, u = s ? `${r}-error` : i ? `${r}-hint` : void 0, d = I();
136
+ return /* @__PURE__ */ c("label", { className: d.root(), htmlFor: r, children: [
137
+ l ? /* @__PURE__ */ e("span", { className: d.label(), children: l }) : null,
138
+ /* @__PURE__ */ e(
139
+ "textarea",
140
+ {
141
+ ref: f,
142
+ id: r,
143
+ className: k(F(), n),
144
+ "aria-invalid": s ? "true" : void 0,
145
+ "aria-describedby": u,
146
+ ...m
147
+ }
148
+ ),
149
+ s ? /* @__PURE__ */ e("span", { id: `${r}-error`, className: d.error(), children: s }) : i ? /* @__PURE__ */ e("span", { id: `${r}-hint`, className: d.hint(), children: i }) : null
150
+ ] });
151
+ }), se = ({
152
+ steps: a,
153
+ currentStep: t,
154
+ orientation: l = "vertical",
155
+ mode: i = "auto",
156
+ mobileLayout: s = "circular",
157
+ mobileLabel: n = "",
158
+ className: m = ""
159
+ }) => {
160
+ var L;
161
+ const [f, h] = B(!1);
162
+ E(() => {
163
+ if (i === "auto") {
164
+ h(window.innerWidth < 640);
165
+ const o = () => {
166
+ h(window.innerWidth < 640);
167
+ };
168
+ return window.addEventListener("resize", o), () => {
169
+ window.removeEventListener("resize", o);
170
+ };
171
+ }
172
+ }, [i]);
173
+ const r = i === "mobile" ? !0 : i === "desktop" ? !1 : f, u = 20, d = 5, x = 2 * Math.PI * u, b = (u + d) * 2, g = 7, $ = M(() => {
174
+ const o = a.length;
175
+ return (x - o * g) / o;
176
+ }, [a.length, x, g]), R = M(() => {
177
+ const o = Math.min(Math.max(t, 1), a.length);
178
+ return Array.from(
179
+ { length: o },
180
+ (p, v) => `${$} ${v < o - 1 ? g : x}`
181
+ ).join(" ");
182
+ }, [t, a.length, $, x, g]), z = ((L = a[Math.min(Math.max(t - 1, 0), a.length - 1)]) == null ? void 0 : L.title) || "", T = n || `Paso ${t} de ${a.length}`, C = (o) => {
183
+ const p = o + 1;
184
+ return p < t ? "completed" : p === t ? "active" : "upcoming";
185
+ }, N = w();
186
+ return r ? s === "circular" ? /* @__PURE__ */ c("div", { className: `${N.mobileRoot()} ${m}`.trim(), children: [
187
+ /* @__PURE__ */ c("div", { className: N.mobileInfo(), children: [
188
+ /* @__PURE__ */ e("span", { className: N.mobileTitle(), children: z }),
189
+ /* @__PURE__ */ e("span", { className: N.mobileLabel(), children: T })
190
+ ] }),
191
+ /* @__PURE__ */ c(
192
+ "div",
193
+ {
194
+ className: N.mobileProgress(),
195
+ style: { width: `${b}px`, height: `${b}px` },
196
+ children: [
197
+ /* @__PURE__ */ c("svg", { width: b, height: b, className: "-rotate-90", children: [
198
+ /* @__PURE__ */ e(
199
+ "circle",
200
+ {
201
+ cx: b / 2,
202
+ cy: b / 2,
203
+ r: u,
204
+ fill: "none",
205
+ className: "stroke-km-border",
206
+ strokeWidth: d,
207
+ strokeDasharray: `${$} ${g}`,
208
+ strokeLinecap: "square"
209
+ }
210
+ ),
211
+ /* @__PURE__ */ e(
212
+ "circle",
213
+ {
214
+ cx: b / 2,
215
+ cy: b / 2,
216
+ r: u,
217
+ fill: "none",
218
+ className: "stroke-km-primary",
219
+ strokeWidth: d,
220
+ strokeDasharray: R,
221
+ strokeLinecap: "square"
222
+ }
223
+ )
224
+ ] }),
225
+ /* @__PURE__ */ c("span", { className: N.mobilePercentText(), children: [
226
+ t,
227
+ "/",
228
+ a.length
229
+ ] })
230
+ ]
231
+ }
232
+ )
233
+ ] }) : /* @__PURE__ */ c("div", { className: `${N.mobileHorizRoot()} ${m}`.trim(), children: [
234
+ /* @__PURE__ */ c("div", { className: N.mobileHorizHeader(), children: [
235
+ /* @__PURE__ */ e("span", { className: N.mobileHorizTitle(), children: z }),
236
+ /* @__PURE__ */ c("span", { className: N.mobileHorizSteps(), children: [
237
+ t,
238
+ "/",
239
+ a.length
240
+ ] })
241
+ ] }),
242
+ /* @__PURE__ */ e("div", { className: N.mobileHorizTrack(), children: a.map((o, p) => /* @__PURE__ */ e(
243
+ "div",
244
+ {
245
+ className: `${N.mobileHorizBar()} ${p + 1 <= t ? "bg-km-primary" : "bg-km-border"}`.trim()
246
+ },
247
+ p
248
+ )) })
249
+ ] }) : l === "horizontal" ? /* @__PURE__ */ e("ol", { className: `flex flex-row items-center justify-between w-full gap-4 ${m}`.trim(), children: a.map((o, p) => {
250
+ const v = C(p), y = p === a.length - 1;
251
+ return /* @__PURE__ */ c("li", { className: "flex items-center flex-1 last:flex-none gap-4", children: [
252
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3 shrink-0", children: [
253
+ /* @__PURE__ */ e("div", { className: w({ state: v }).stepCircle(), children: v === "completed" ? /* @__PURE__ */ e(
254
+ "svg",
255
+ {
256
+ width: "20",
257
+ height: "20",
258
+ viewBox: "0 0 24 24",
259
+ fill: "none",
260
+ stroke: "currentColor",
261
+ strokeWidth: "3",
262
+ strokeLinecap: "round",
263
+ strokeLinejoin: "round",
264
+ className: "w-5 h-5",
265
+ children: /* @__PURE__ */ e("polyline", { points: "20 6 9 17 4 12" })
266
+ }
267
+ ) : /* @__PURE__ */ e("span", { className: "text-sm font-bold", children: p + 1 }) }),
268
+ /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
269
+ /* @__PURE__ */ e("span", { className: `${w({ state: v }).title()} text-sm font-bold whitespace-nowrap`, children: o.title }),
270
+ o.description && /* @__PURE__ */ e("span", { className: "text-xs text-km-muted-foreground whitespace-nowrap max-w-[150px] truncate", children: o.description })
271
+ ] })
272
+ ] }),
273
+ !y && /* @__PURE__ */ e(
274
+ "div",
275
+ {
276
+ className: `flex-1 h-[3px] rounded-full transition-all duration-300 ${v === "completed" ? "bg-km-success" : v === "active" ? "bg-gradient-to-r from-km-primary to-km-border" : "bg-km-border"}`.trim()
277
+ }
278
+ )
279
+ ] }, o.title);
280
+ }) }) : /* @__PURE__ */ e("ol", { className: `${w({ orientation: "vertical" }).root()} ${m}`.trim(), children: a.map((o, p) => {
281
+ const v = C(p), y = p === a.length - 1;
282
+ return /* @__PURE__ */ c("li", { className: N.step(), children: [
283
+ /* @__PURE__ */ c("div", { className: N.stepContainer(), children: [
284
+ /* @__PURE__ */ e("div", { className: w({ state: v }).stepCircle(), children: v === "completed" ? /* @__PURE__ */ e(
285
+ "svg",
286
+ {
287
+ width: "20",
288
+ height: "20",
289
+ viewBox: "0 0 24 24",
290
+ fill: "none",
291
+ stroke: "currentColor",
292
+ strokeWidth: "3",
293
+ strokeLinecap: "round",
294
+ strokeLinejoin: "round",
295
+ className: "w-5 h-5",
296
+ children: /* @__PURE__ */ e("polyline", { points: "20 6 9 17 4 12" })
297
+ }
298
+ ) : /* @__PURE__ */ e("span", { className: "text-sm font-bold", children: p + 1 }) }),
299
+ !y && /* @__PURE__ */ e(
300
+ "div",
301
+ {
302
+ className: `${w({ state: v, orientation: "vertical" }).connector()} ${v === "active" ? "bg-gradient-to-b from-km-primary to-km-border" : ""}`.trim()
303
+ }
304
+ )
305
+ ] }),
306
+ /* @__PURE__ */ c("div", { className: N.content(), children: [
307
+ /* @__PURE__ */ e("span", { className: w({ state: v }).title(), children: o.title }),
308
+ o.description && /* @__PURE__ */ e("span", { className: N.description(), children: o.description })
309
+ ] })
310
+ ] }, o.title);
311
+ }) });
312
+ }, ie = ({
313
+ isChecked: a = !1,
314
+ onChange: t,
315
+ label: l = "",
316
+ size: i = "medium",
317
+ disabled: s = !1,
318
+ className: n = ""
319
+ }) => {
320
+ const [m, f] = B(a);
321
+ E(() => {
322
+ f(a);
323
+ }, [a]);
324
+ const h = () => {
325
+ if (s) return;
326
+ const u = !m;
327
+ f(u), t && t(u);
328
+ }, r = q({
329
+ size: i,
330
+ checked: m,
331
+ disabled: s
332
+ });
333
+ return /* @__PURE__ */ c("div", { className: `${r.root()} ${n}`.trim(), children: [
334
+ l && /* @__PURE__ */ e("span", { className: r.label(), onClick: h, children: l }),
335
+ /* @__PURE__ */ e(
336
+ "div",
337
+ {
338
+ className: r.track(),
339
+ onClick: h,
340
+ role: "checkbox",
341
+ "aria-checked": m,
342
+ "aria-disabled": s,
343
+ tabIndex: 0,
344
+ onKeyDown: (u) => {
345
+ (u.key === " " || u.key === "Enter") && (u.preventDefault(), h());
346
+ },
347
+ children: /* @__PURE__ */ e("div", { className: r.thumb() })
348
+ }
349
+ )
350
+ ] });
351
+ };
352
+ export {
353
+ Z as KmAlert,
354
+ J as KmBadge,
355
+ Q as KmButton,
356
+ X as KmCard,
357
+ Y as KmInput,
358
+ ee as KmSelect,
359
+ ae as KmStack,
360
+ se as KmStepper,
361
+ te as KmTextarea,
362
+ ie as KmToggleSwitch
363
+ };