kahuna-base-react-components 0.1.8
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/.storybook/main.ts +19 -0
- package/.storybook/preview.ts +15 -0
- package/README.md +23 -0
- package/babel.config.js +7 -0
- package/dist/components/KButton/KButton.d.ts +19 -0
- package/dist/components/KButton/index.d.ts +1 -0
- package/dist/components/KDropdown/KDropdown.d.ts +30 -0
- package/dist/components/KDropdown/index.d.ts +1 -0
- package/dist/components/KInput/KInput.d.ts +21 -0
- package/dist/components/KInput/index.d.ts +1 -0
- package/dist/components/KLogo/KLogo.d.ts +11 -0
- package/dist/components/KLogo/index.d.ts +1 -0
- package/dist/components/KSlider/KSlider.d.ts +16 -0
- package/dist/components/KSlider/index.d.ts +1 -0
- package/dist/components/KSpan/KSpan.d.ts +13 -0
- package/dist/components/KSpan/index.d.ts +1 -0
- package/dist/components/KTitleSpan/KTitleSpan.d.ts +13 -0
- package/dist/components/KTitleSpan/index.d.ts +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.esm.js +10 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +112 -0
- package/package.json +68 -0
- package/postcss.config.js +6 -0
- package/rollup.config.js +48 -0
- package/src/assets/chevron-left.svg +7 -0
- package/src/assets/chevron-right.svg +7 -0
- package/src/assets/logo.svg +14 -0
- package/src/assets/slider-dots.svg +7 -0
- package/src/assets/tracks.svg +5 -0
- package/src/components/KButton/KButton.stories.tsx +78 -0
- package/src/components/KButton/KButton.tsx +44 -0
- package/src/components/KButton/index.ts +1 -0
- package/src/components/KDropdown/KDropdown.stories.tsx +62 -0
- package/src/components/KDropdown/KDropdown.tsx +93 -0
- package/src/components/KDropdown/index.ts +1 -0
- package/src/components/KInput/KInput.stories.tsx +54 -0
- package/src/components/KInput/KInput.tsx +67 -0
- package/src/components/KInput/index.ts +1 -0
- package/src/components/KLogo/KLogo.stories.tsx +36 -0
- package/src/components/KLogo/KLogo.tsx +31 -0
- package/src/components/KLogo/index.ts +1 -0
- package/src/components/KSlider/KSlider.stories.tsx +18 -0
- package/src/components/KSlider/KSlider.tsx +40 -0
- package/src/components/KSlider/index.ts +1 -0
- package/src/components/KSpan/KSpan.stories.tsx +23 -0
- package/src/components/KSpan/KSpan.tsx +29 -0
- package/src/components/KSpan/index.ts +1 -0
- package/src/components/KTitleSpan/KTitleSpan.stories.tsx +23 -0
- package/src/components/KTitleSpan/KTitleSpan.tsx +29 -0
- package/src/components/KTitleSpan/index.ts +1 -0
- package/src/index.ts +11 -0
- package/src/main.css +93 -0
- package/tailwind.config.js +9 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StorybookConfig } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-links",
|
|
7
|
+
"@storybook/addon-essentials",
|
|
8
|
+
"@storybook/addon-onboarding",
|
|
9
|
+
"@storybook/addon-interactions",
|
|
10
|
+
],
|
|
11
|
+
framework: {
|
|
12
|
+
name: "@storybook/react-vite",
|
|
13
|
+
options: {},
|
|
14
|
+
},
|
|
15
|
+
docs: {
|
|
16
|
+
autodocs: "tag",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default config;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Preview } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
const preview: Preview = {
|
|
4
|
+
parameters: {
|
|
5
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
6
|
+
controls: {
|
|
7
|
+
matchers: {
|
|
8
|
+
color: /(background|color)$/i,
|
|
9
|
+
date: /Date$/i,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default preview;
|
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)
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../main.css";
|
|
3
|
+
export interface KButtonProps {
|
|
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;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
textColor?: string;
|
|
15
|
+
padding?: string;
|
|
16
|
+
shadowDisabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const KButton: React.FC<KButtonProps>;
|
|
19
|
+
export default KButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KButton';
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
11
|
+
export interface KDropdownProps {
|
|
12
|
+
defaultValue?: KSelectOption | MultiValue<KSelectOption>;
|
|
13
|
+
selected?: KSelectOption | MultiValue<KSelectOption>;
|
|
14
|
+
onSelect: (selected: KSelectOption | MultiValue<KSelectOption>) => void;
|
|
15
|
+
options: KSelectOption[];
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
leftIcon?: string;
|
|
19
|
+
rightIcon?: string;
|
|
20
|
+
background?: string;
|
|
21
|
+
activeBackground?: string;
|
|
22
|
+
borderRadius?: number;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
isMulti?: boolean;
|
|
25
|
+
label?: string;
|
|
26
|
+
textColor?: string;
|
|
27
|
+
shadowDisabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare const KDropdown: React.FC<KDropdownProps>;
|
|
30
|
+
export default KDropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KDropdown';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../main.css";
|
|
3
|
+
export interface KInputProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
leftIcon?: string;
|
|
9
|
+
rightIcon?: string;
|
|
10
|
+
background?: string;
|
|
11
|
+
activeBackground?: string;
|
|
12
|
+
borderRadius?: number;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
shadowDisabled?: boolean;
|
|
15
|
+
type?: string;
|
|
16
|
+
leftIconClick?: () => void;
|
|
17
|
+
rightIconClick?: () => void;
|
|
18
|
+
accentColor?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const KInput: React.FC<KInputProps>;
|
|
21
|
+
export default KInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KInput';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../main.css";
|
|
3
|
+
export interface KLogoProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
borderRadius?: number;
|
|
7
|
+
primaryText?: string;
|
|
8
|
+
secondaryText?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const KLogo: React.FC<KLogoProps>;
|
|
11
|
+
export default KLogo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KLogo';
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
height?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const KSlider: React.FC<KSliderProps>;
|
|
16
|
+
export default KSlider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KSlider';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../main.css";
|
|
3
|
+
export interface KSpanProps {
|
|
4
|
+
text: string;
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
fontWeight?: number;
|
|
8
|
+
lineHeight?: string;
|
|
9
|
+
fontStyle?: string;
|
|
10
|
+
letterSpacing?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const KSpan: React.FC<KSpanProps>;
|
|
13
|
+
export default KSpan;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KSpan';
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
12
|
+
declare const KTitleSpan: React.FC<KTitleSpanProps>;
|
|
13
|
+
export default KTitleSpan;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './KTitleSpan';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import KButton from "./components/KButton";
|
|
2
|
+
import KSpan from "./components/KSpan";
|
|
3
|
+
import KTitleSpan from "./components/KTitleSpan";
|
|
4
|
+
import KLogo from "./components/KLogo";
|
|
5
|
+
import KInput from "./components/KInput";
|
|
6
|
+
import KDropdown from "./components/KDropdown";
|
|
7
|
+
import KSlider from "./components/KSlider";
|
|
8
|
+
export { KButton, KSpan, KLogo, KTitleSpan, KInput, KDropdown, KSlider };
|