kahuna-base-react-components 1.0.7 → 1.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 (149) hide show
  1. package/.prettierrc +8 -0
  2. package/README.md +23 -0
  3. package/dist/components/KButton/KButton.d.ts +17 -3
  4. package/dist/components/KCodeInput/KCodeInput.d.ts +36 -0
  5. package/dist/components/KCodeInput/index.d.ts +1 -0
  6. package/dist/components/KDropdown/KDropdown.d.ts +38 -0
  7. package/dist/components/KDropdown/index.d.ts +1 -0
  8. package/dist/components/KDropdownToggle/KDropdownToggle.d.ts +35 -0
  9. package/dist/components/KDropdownToggle/index.d.ts +1 -0
  10. package/dist/components/KInput/KInput.d.ts +32 -0
  11. package/dist/components/KInput/index.d.ts +1 -0
  12. package/dist/components/KLogo/KLogo.d.ts +18 -0
  13. package/dist/components/KLogo/index.d.ts +1 -0
  14. package/dist/components/KSelectDate/KSelectDate.d.ts +9 -0
  15. package/dist/components/KSelectDate/index.d.ts +1 -0
  16. package/dist/components/KSlider/KSlider.d.ts +15 -0
  17. package/dist/components/KSlider/index.d.ts +1 -0
  18. package/dist/components/KSliderLabel/KSliderLabel.d.ts +19 -0
  19. package/dist/components/KSliderLabel/index.d.ts +1 -0
  20. package/dist/components/KSpan/KSpan.d.ts +14 -4
  21. package/dist/components/KTextArea/KTextArea.d.ts +32 -0
  22. package/dist/components/KTextArea/index.d.ts +1 -0
  23. package/dist/components/KTitleSpan/KTitleSpan.d.ts +14 -0
  24. package/dist/components/KTitleSpan/index.d.ts +1 -0
  25. package/dist/components/KTooltip/KTooltip.d.ts +19 -0
  26. package/dist/components/KTooltip/index.d.ts +1 -0
  27. package/dist/fonts/AeonikPro-Bold/AeonikPro-Bold.otf +0 -0
  28. package/dist/fonts/AeonikPro-Bold/CoType EULA Desktop.pdf +1388 -3
  29. package/dist/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
  30. package/dist/fonts/Inter/OFL.txt +93 -0
  31. package/dist/fonts/Inter/README.txt +72 -0
  32. package/dist/fonts/Inter/static/Inter-Black.ttf +0 -0
  33. package/dist/fonts/Inter/static/Inter-Bold.ttf +0 -0
  34. package/dist/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
  35. package/dist/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
  36. package/dist/fonts/Inter/static/Inter-Light.ttf +0 -0
  37. package/dist/fonts/Inter/static/Inter-Medium.ttf +0 -0
  38. package/dist/fonts/Inter/static/Inter-Regular.ttf +0 -0
  39. package/dist/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
  40. package/dist/fonts/Inter/static/Inter-Thin.ttf +0 -0
  41. package/dist/index.d.ts +11 -1
  42. package/dist/index.esm.js +9 -1
  43. package/dist/index.esm.js.map +1 -1
  44. package/dist/index.js +9 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/types.d.ts +241 -8
  47. package/package.json +14 -3
  48. package/postcss.config.js +6 -0
  49. package/removeUseClient.js +22 -0
  50. package/rollup.config.js +9 -3
  51. package/src/assets/calendar-hovered.svg +3 -0
  52. package/src/assets/calendar.svg +3 -0
  53. package/src/assets/check.svg +3 -0
  54. package/src/assets/chevron-left.svg +7 -0
  55. package/src/assets/chevron-right.svg +7 -0
  56. package/src/assets/fonts/AeonikPro/AeonikPro-Bold.otf +0 -0
  57. package/src/assets/fonts/AeonikPro/AeonikPro-Medium.otf +0 -0
  58. package/src/assets/fonts/AeonikPro/CoType EULA Desktop.pdf +1388 -3
  59. package/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
  60. package/src/assets/fonts/Inter/OFL.txt +93 -0
  61. package/src/assets/fonts/Inter/README.txt +72 -0
  62. package/src/assets/fonts/Inter/static/Inter-Black.ttf +0 -0
  63. package/src/assets/fonts/Inter/static/Inter-Bold.ttf +0 -0
  64. package/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
  65. package/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
  66. package/src/assets/fonts/Inter/static/Inter-Light.ttf +0 -0
  67. package/src/assets/fonts/Inter/static/Inter-Medium.ttf +0 -0
  68. package/src/assets/fonts/Inter/static/Inter-Regular.ttf +0 -0
  69. package/src/assets/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
  70. package/src/assets/fonts/Inter/static/Inter-Thin.ttf +0 -0
  71. package/src/assets/kahuna-text.svg +3 -0
  72. package/src/assets/logo-gray.svg +10 -0
  73. package/src/assets/logo-small-hovered.svg +4 -0
  74. package/src/assets/logo-small.svg +11 -0
  75. package/src/assets/logo.svg +11 -0
  76. package/src/assets/progress.svg +37 -0
  77. package/src/assets/separator.svg +3 -0
  78. package/src/assets/slider-dots.svg +7 -0
  79. package/src/assets/slider-step.svg +3 -0
  80. package/src/assets/slider-thumb.svg +3 -0
  81. package/src/assets/tracks.svg +5 -0
  82. package/src/assets/union.svg +3 -0
  83. package/src/assets/vector.svg +3 -0
  84. package/src/components/KButton/KButton.stories.tsx +69 -12
  85. package/src/components/KButton/KButton.tsx +51 -14
  86. package/src/components/KCodeInput/KCodeInput.stories.tsx +84 -0
  87. package/src/components/KCodeInput/KCodeInput.tsx +260 -0
  88. package/src/components/KCodeInput/index.ts +1 -0
  89. package/src/components/KDropdown/KDropdown.stories.tsx +90 -0
  90. package/src/components/KDropdown/KDropdown.tsx +201 -0
  91. package/src/components/KDropdown/index.ts +1 -0
  92. package/src/components/KInput/KInput.stories.tsx +84 -0
  93. package/src/components/KInput/KInput.tsx +128 -0
  94. package/src/components/KInput/index.ts +1 -0
  95. package/src/components/KLogo/KLogo.stories.tsx +24 -0
  96. package/src/components/KLogo/KLogo.tsx +79 -0
  97. package/src/components/KLogo/index.ts +1 -0
  98. package/src/components/KSelectDate/CalendarCustom.css +235 -0
  99. package/src/components/KSelectDate/KSelectDate.stories.tsx +54 -0
  100. package/src/components/KSelectDate/KSelectDate.tsx +314 -0
  101. package/src/components/KSelectDate/index.ts +1 -0
  102. package/src/components/KSlider/KSlider.stories.tsx +19 -0
  103. package/src/components/KSlider/KSlider.tsx +67 -0
  104. package/src/components/KSlider/index.ts +1 -0
  105. package/src/components/KSliderLabel/KSliderLabel.stories.tsx +61 -0
  106. package/src/components/KSliderLabel/KSliderLabel.tsx +137 -0
  107. package/src/components/KSliderLabel/index.ts +1 -0
  108. package/src/components/KSpan/KSpan.stories.tsx +31 -11
  109. package/src/components/KSpan/KSpan.tsx +65 -9
  110. package/src/components/KTextArea/KTextArea.stories.tsx +65 -0
  111. package/src/components/KTextArea/KTextArea.tsx +130 -0
  112. package/src/components/KTextArea/index.ts +1 -0
  113. package/src/components/KTitleSpan/KTitleSpan.stories.tsx +23 -0
  114. package/src/components/KTitleSpan/KTitleSpan.tsx +33 -0
  115. package/src/components/KTitleSpan/index.ts +1 -0
  116. package/src/components/KTooltip/KTooltip.stories.tsx +94 -0
  117. package/src/components/KTooltip/KTooltip.tsx +67 -0
  118. package/src/components/KTooltip/index.ts +1 -0
  119. package/src/index.ts +12 -1
  120. package/src/main.css +251 -0
  121. package/tailwind.config.js +9 -0
  122. package/dist/components/KButton/KButton.stories.d.ts +0 -4
  123. package/dist/components/KSpan/KSpan.stories.d.ts +0 -3
  124. package/src/stories/Button.stories.ts +0 -50
  125. package/src/stories/Button.tsx +0 -48
  126. package/src/stories/Configure.mdx +0 -364
  127. package/src/stories/Header.stories.ts +0 -27
  128. package/src/stories/Header.tsx +0 -56
  129. package/src/stories/Page.stories.ts +0 -32
  130. package/src/stories/Page.tsx +0 -73
  131. package/src/stories/assets/accessibility.png +0 -0
  132. package/src/stories/assets/accessibility.svg +0 -5
  133. package/src/stories/assets/addon-library.png +0 -0
  134. package/src/stories/assets/assets.png +0 -0
  135. package/src/stories/assets/avif-test-image.avif +0 -0
  136. package/src/stories/assets/context.png +0 -0
  137. package/src/stories/assets/discord.svg +0 -15
  138. package/src/stories/assets/docs.png +0 -0
  139. package/src/stories/assets/figma-plugin.png +0 -0
  140. package/src/stories/assets/github.svg +0 -3
  141. package/src/stories/assets/share.png +0 -0
  142. package/src/stories/assets/styling.png +0 -0
  143. package/src/stories/assets/testing.png +0 -0
  144. package/src/stories/assets/theming.png +0 -0
  145. package/src/stories/assets/tutorials.svg +0 -12
  146. package/src/stories/assets/youtube.svg +0 -4
  147. package/src/stories/button.css +0 -30
  148. package/src/stories/header.css +0 -32
  149. package/src/stories/page.css +0 -69
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "semi": false,
3
+ "tabWidth": 2,
4
+ "printWidth": 120,
5
+ "singleQuote": false,
6
+ "trailingComma": "none",
7
+ "bracketSameLine": false
8
+ }
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Introduction
2
+ React library for base components shared across various projects, encompassing custom, wrappers, or straightforward components.
3
+ The objective of this initiative is to establish generic and uncomplicated logic that can be readily reused and distributed as required.
4
+ This endeavor aims to streamline and enhance Kahuna's software development process.
5
+
6
+ # Getting Started
7
+ Please run the following to get started with the repo
8
+ 1. npm Install
9
+ 2. npm run build-storybook
10
+ 3. npm run storybook
11
+
12
+ # Build and Test
13
+ 1. npm run build - this will create a dist folder with all the new declaration types and js files needed
14
+ 2. npm run storybook - run this if you need to check your custom component before deployment
15
+
16
+ # Import Library
17
+ 1. npm install git+https://github.com/Kahuna-Music/kahuna-base-react-components.git#{tag}
18
+ 2. e.g. 'npm install git+https://github.com/Kahuna-Music/kahuna-base-react-components.git#1.0.1'
19
+
20
+ # Useful links
21
+ - [Storybook](https://storybook.js.org/)
22
+ - [RollupJS](https://rollupjs.org/guide/en/)
23
+ - [Rollup Plugins](https://github.com/rollup/plugins)
@@ -1,9 +1,23 @@
1
1
  import React from "react";
2
+ import "../../main.css";
2
3
  export interface KButtonProps {
3
- testIdPrefix: string;
4
- label?: string;
5
- theme: "primary" | "secondary";
4
+ onClick: () => void;
5
+ text?: string;
6
+ icon?: string;
7
+ rightIcon?: string;
8
+ leftIcon?: string;
9
+ background?: string;
10
+ borderRadius?: number;
11
+ width?: string;
12
+ height?: string;
6
13
  disabled?: boolean;
14
+ textColor?: string;
15
+ padding?: string;
16
+ shadowDisabled?: boolean;
17
+ hoverBackground?: string;
18
+ fontWeight?: number;
19
+ textDecoration?: string;
20
+ gap?: string;
7
21
  }
8
22
  declare const KButton: React.FC<KButtonProps>;
9
23
  export default KButton;
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface KCodeInputProps {
4
+ onChange: (value: string) => void;
5
+ length?: number;
6
+ borderRadius?: number;
7
+ disabled?: boolean;
8
+ padding?: string;
9
+ gap?: number;
10
+ fontSize?: string;
11
+ fontWeight?: string;
12
+ color?: string;
13
+ lineHeight?: string;
14
+ allowedCharacters?: "numeric" | "alphaNumeric" | "alpha";
15
+ width?: number;
16
+ height?: number;
17
+ autoFocus?: boolean;
18
+ isPassword?: boolean;
19
+ background?: string;
20
+ hoverBackground?: string;
21
+ focusedBackground?: string;
22
+ filledBackground?: string;
23
+ border?: string;
24
+ hoverBorder?: string;
25
+ focusedBorder?: string;
26
+ filledBorder?: string;
27
+ boxShadow?: string;
28
+ hoverBoxShadow?: string;
29
+ focusedBoxShadow?: string;
30
+ filledBoxShadow?: string;
31
+ fitInContainer?: boolean;
32
+ isCodeCorrect?: boolean;
33
+ autoBlur?: boolean;
34
+ }
35
+ declare const KInput: React.FC<KCodeInputProps>;
36
+ export default KInput;
@@ -0,0 +1 @@
1
+ export { default } from './KCodeInput';
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ import { MultiValue } from "react-select";
4
+ export interface KSelectOption {
5
+ label: string;
6
+ value: number;
7
+ type?: string;
8
+ label2?: string;
9
+ value2?: string;
10
+ icon?: string;
11
+ }
12
+ export interface KDropdownProps {
13
+ defaultValue?: KSelectOption | MultiValue<KSelectOption>;
14
+ defaultValuePrimitive?: string | number;
15
+ selected?: KSelectOption | MultiValue<KSelectOption>;
16
+ onSelect: (selected: KSelectOption | MultiValue<KSelectOption> | undefined) => void;
17
+ options: KSelectOption[];
18
+ width?: number;
19
+ height?: number;
20
+ leftIcon?: string;
21
+ rightIcon?: string;
22
+ background?: string;
23
+ activeBackground?: string;
24
+ borderRadius?: number;
25
+ placeholder?: string;
26
+ isMulti?: boolean;
27
+ label?: string;
28
+ textColor?: string;
29
+ shadowDisabled?: boolean;
30
+ menuBackground?: string;
31
+ padding?: string;
32
+ gap?: string;
33
+ hideChosenOptionIcon?: boolean;
34
+ isClearable?: boolean;
35
+ isEllipsis?: boolean;
36
+ }
37
+ declare const KDropdown: React.FC<KDropdownProps>;
38
+ export default KDropdown;
@@ -0,0 +1 @@
1
+ export { default } from './KDropdown';
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ import { MultiValue } from "react-select";
4
+ export interface KSelectOption {
5
+ label: string;
6
+ value: number;
7
+ type?: string;
8
+ label2?: string;
9
+ value2?: string;
10
+ icon?: string;
11
+ }
12
+ export interface KDropdownProps {
13
+ defaultValue?: KSelectOption | MultiValue<KSelectOption>;
14
+ selected?: KSelectOption | MultiValue<KSelectOption>;
15
+ onSelect: (selected: KSelectOption | MultiValue<KSelectOption>) => void;
16
+ options: KSelectOption[];
17
+ width?: number;
18
+ height?: number;
19
+ leftIcon?: string;
20
+ rightIcon?: string;
21
+ background?: string;
22
+ activeBackground?: string;
23
+ borderRadius?: number;
24
+ placeholder?: string;
25
+ isMulti?: boolean;
26
+ label?: string;
27
+ textColor?: string;
28
+ shadowDisabled?: boolean;
29
+ menuBackground?: string;
30
+ padding?: string;
31
+ gap?: string;
32
+ hideChosenOptionIcon?: boolean;
33
+ }
34
+ declare const KDropdownToggle: React.FC<KDropdownProps>;
35
+ export default KDropdownToggle;
@@ -0,0 +1 @@
1
+ export { default } from './KDropdownToggle';
@@ -0,0 +1,32 @@
1
+ import React, { KeyboardEvent } from "react";
2
+ import "../../main.css";
3
+ export interface KInputProps {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ onBlur?: (value: string) => void;
7
+ onKeyDown?: (event: KeyboardEvent) => void;
8
+ width?: number;
9
+ height?: number;
10
+ leftIcon?: string;
11
+ rightIcon?: string;
12
+ background?: string;
13
+ activeBackground?: string;
14
+ borderRadius?: number;
15
+ disabled?: boolean;
16
+ placeholder?: string;
17
+ shadowDisabled?: boolean;
18
+ type?: string;
19
+ leftIconClick?: () => void;
20
+ rightIconClick?: () => void;
21
+ accentColor?: string;
22
+ hoverBackground?: string;
23
+ padding?: string;
24
+ gap?: string;
25
+ border?: string;
26
+ boxShadow?: string;
27
+ fontSize?: string;
28
+ iconSize?: string;
29
+ checked?: boolean;
30
+ }
31
+ declare const KInput: React.FC<KInputProps>;
32
+ export default KInput;
@@ -0,0 +1 @@
1
+ export { default } from './KInput';
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface KLogoProps {
4
+ width?: number;
5
+ height?: number;
6
+ borderRadius?: number;
7
+ primaryTextVisible?: boolean;
8
+ secondaryText?: string;
9
+ logoColor?: string;
10
+ hoverEnabled?: boolean;
11
+ secondaryTextColor?: string;
12
+ secondaryTextFontSize?: number;
13
+ hideIcon?: boolean;
14
+ primaryTextWidth?: number;
15
+ primaryTextHeight?: number;
16
+ }
17
+ declare const KLogo: React.FC<KLogoProps>;
18
+ export default KLogo;
@@ -0,0 +1 @@
1
+ export { default } from './KLogo';
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import "./CalendarCustom.css";
3
+ import "../../main.css";
4
+ export interface KSelectDateProps {
5
+ value: Date | undefined;
6
+ onChange: (date: Date | undefined) => void;
7
+ }
8
+ declare const KSelectDate: React.FC<KSelectDateProps>;
9
+ export default KSelectDate;
@@ -0,0 +1 @@
1
+ export { default } from './KSelectDate';
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface SliderOption {
4
+ label: string;
5
+ value: number;
6
+ }
7
+ export interface KSliderProps {
8
+ options: SliderOption[];
9
+ onChange: (option: SliderOption) => void;
10
+ value?: number;
11
+ disabled?: boolean;
12
+ width?: string;
13
+ }
14
+ declare const KSlider: React.FC<KSliderProps>;
15
+ export default KSlider;
@@ -0,0 +1 @@
1
+ export { default } from './KSlider';
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface SliderLabelOption {
4
+ label: string;
5
+ value: number;
6
+ }
7
+ export interface SliderLabelProps {
8
+ options: SliderLabelOption[];
9
+ onChange: (option: SliderLabelOption) => void;
10
+ value?: number;
11
+ disabled?: boolean;
12
+ width?: string;
13
+ titleText?: string;
14
+ valueText?: string;
15
+ fontSize?: number;
16
+ color?: string;
17
+ }
18
+ declare const KSliderLabel: React.FC<SliderLabelProps>;
19
+ export default KSliderLabel;
@@ -0,0 +1 @@
1
+ export { default } from './KSliderLabel';
@@ -1,8 +1,18 @@
1
- import React from "react";
1
+ import React, { CSSProperties } from "react";
2
+ import "../../main.css";
2
3
  export interface KSpanProps {
3
- testIdPrefix: string;
4
- text?: string;
5
- theme: "primary" | "secondary";
4
+ text: string;
5
+ fontSize?: number;
6
+ color?: string;
7
+ fontWeight?: number;
8
+ lineHeight?: string;
9
+ fontStyle?: string;
10
+ letterSpacing?: string;
11
+ hoverText?: string;
12
+ hoverTextColor?: string;
13
+ hoverStyle?: CSSProperties;
14
+ textDecoration?: string;
15
+ ellipsis?: boolean;
6
16
  }
7
17
  declare const KSpan: React.FC<KSpanProps>;
8
18
  export default KSpan;
@@ -0,0 +1,32 @@
1
+ import React, { KeyboardEvent } from "react";
2
+ import "../../main.css";
3
+ export interface KTextAreaProps {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ rows?: number;
7
+ onBlur?: (value: string) => void;
8
+ onKeyDown?: (event: KeyboardEvent) => void;
9
+ width?: number;
10
+ height?: number;
11
+ leftIcon?: string;
12
+ rightIcon?: string;
13
+ background?: string;
14
+ activeBackground?: string;
15
+ borderRadius?: number;
16
+ disabled?: boolean;
17
+ placeholder?: string;
18
+ shadowDisabled?: boolean;
19
+ leftIconClick?: () => void;
20
+ rightIconClick?: () => void;
21
+ accentColor?: string;
22
+ hoverBackground?: string;
23
+ padding?: string;
24
+ gap?: string;
25
+ border?: string;
26
+ boxShadow?: string;
27
+ fontSize?: string;
28
+ iconSize?: string;
29
+ checked?: boolean;
30
+ }
31
+ declare const KTextArea: React.FC<KTextAreaProps>;
32
+ export default KTextArea;
@@ -0,0 +1 @@
1
+ export { default } from './KTextArea';
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface KTitleSpanProps {
4
+ text: string;
5
+ fontSize?: number;
6
+ color?: string;
7
+ fontWeight?: number;
8
+ lineHeight?: string;
9
+ fontStyle?: string;
10
+ letterSpacing?: string;
11
+ bold?: boolean;
12
+ }
13
+ declare const KTitleSpan: React.FC<KTitleSpanProps>;
14
+ export default KTitleSpan;
@@ -0,0 +1 @@
1
+ export { default } from './KTitleSpan';
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "../../main.css";
3
+ export interface KTooltipProps {
4
+ children: React.ReactNode;
5
+ content: React.ReactNode;
6
+ position?: string;
7
+ backgroundColor?: string;
8
+ width?: string;
9
+ height?: string;
10
+ zIndex?: number;
11
+ border?: string;
12
+ borderRadius?: string;
13
+ boxShadow?: string;
14
+ showArrow?: boolean;
15
+ arrowColor?: string;
16
+ padding?: string;
17
+ }
18
+ declare const KTooltip: React.FC<KTooltipProps>;
19
+ export default KTooltip;
@@ -0,0 +1 @@
1
+ export { default } from './KTooltip';