cc-ui-library 1.0.1

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 (80) hide show
  1. package/.prettierrc.js +13 -0
  2. package/.storybook/main.ts +25 -0
  3. package/.storybook/preview.ts +24 -0
  4. package/.yarn/install-state.gz +0 -0
  5. package/.yarnrc.yml +1 -0
  6. package/README.md +25 -0
  7. package/dist/tsconfig.tsbuildinfo +1 -0
  8. package/index.scss +0 -0
  9. package/lib/assets/utils/functionUtils.d.ts +1 -0
  10. package/lib/components/Button/Button.d.ts +7 -0
  11. package/lib/components/Button/Button.stories.d.ts +10 -0
  12. package/lib/components/Button/index.d.ts +1 -0
  13. package/lib/components/Button/types.d.ts +68 -0
  14. package/lib/components/Icon/Icon.d.ts +4 -0
  15. package/lib/components/Icon/Icon.stories.d.ts +7 -0
  16. package/lib/components/Icon/iconList.d.ts +2 -0
  17. package/lib/components/Icon/index.d.ts +1 -0
  18. package/lib/components/Icon/types.d.ts +10 -0
  19. package/lib/components/Toggle/Toggle.d.ts +5 -0
  20. package/lib/components/Toggle/Toggle.stories.d.ts +9 -0
  21. package/lib/components/Toggle/index.d.ts +1 -0
  22. package/lib/components/Toggle/types.d.ts +22 -0
  23. package/lib/hooks/useClickOutside.d.ts +2 -0
  24. package/lib/index.d.ts +118 -0
  25. package/lib/index.esm.js +1054 -0
  26. package/lib/index.esm.js.map +1 -0
  27. package/lib/index.js +1079 -0
  28. package/lib/index.js.map +1 -0
  29. package/lib/tsconfig.tsbuildinfo +1 -0
  30. package/lib/utils/checkEmpty/checkEmpty.d.ts +3 -0
  31. package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
  32. package/package.json +58 -0
  33. package/rollup.config.mjs +57 -0
  34. package/src/assets/icons/logo.svg +18 -0
  35. package/src/assets/styles/_colors.scss +23 -0
  36. package/src/assets/styles/_rsfonts.scss +228 -0
  37. package/src/assets/utils/functionUtils.ts +5 -0
  38. package/src/components/Button/Button.scss +5 -0
  39. package/src/components/Button/Button.stories.tsx +56 -0
  40. package/src/components/Button/Button.tsx +38 -0
  41. package/src/components/Button/index.ts +1 -0
  42. package/src/components/Button/types.ts +71 -0
  43. package/src/components/Icon/Icon.stories.tsx +37 -0
  44. package/src/components/Icon/Icon.tsx +42 -0
  45. package/src/components/Icon/Icons.scss +33 -0
  46. package/src/components/Icon/iconList.ts +8 -0
  47. package/src/components/Icon/index.ts +1 -0
  48. package/src/components/Icon/types.ts +10 -0
  49. package/src/components/Toggle/Toggle.scss +153 -0
  50. package/src/components/Toggle/Toggle.stories.tsx +55 -0
  51. package/src/components/Toggle/Toggle.tsx +55 -0
  52. package/src/components/Toggle/index.ts +1 -0
  53. package/src/components/Toggle/types.ts +22 -0
  54. package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
  55. package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  56. package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  57. package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
  58. package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  59. package/src/fonts/Poppins/Poppins-Bold.ttf +0 -0
  60. package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  61. package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  62. package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  63. package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  64. package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  65. package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
  66. package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
  67. package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  68. package/src/fonts/Poppins/Poppins-Medium.ttf +0 -0
  69. package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  70. package/src/fonts/Poppins/Poppins-Regular.ttf +0 -0
  71. package/src/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  72. package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  73. package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
  74. package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  75. package/src/hooks/useClickOutside.tsx +21 -0
  76. package/src/index.ts +13 -0
  77. package/src/utils/checkEmpty/checkEmpty.stories.tsx +34 -0
  78. package/src/utils/checkEmpty/checkEmpty.ts +10 -0
  79. package/tsconfig.json +52 -0
  80. package/vite.config.js +30 -0
package/.prettierrc.js ADDED
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ printWidth: 80, // max 080 chars in line, code is easy to read
3
+ useTabs: false, // use spaces instead of tabs
4
+ tabWidth: 2, // "visual width" of of the "tab"
5
+ trailingComma: 'es5', // add trailing commas in objects, arrays, etc.
6
+ semi: true, // add ; when needed
7
+ singleQuote: true, // '' for stings instead of ""
8
+ bracketSpacing: true, // import { some } ... instead of import {some} ...
9
+ arrowParens: 'always', // braces even for single param in arrow functions (a) => { }
10
+ jsxSingleQuote: false, // "" for react props, like in html
11
+ bracketSameLine: false, // pretty JSX
12
+ endOfLine: 'lf', // 'lf' for linux, 'crlf' for windows, we need to use 'lf' for git
13
+ };
@@ -0,0 +1,25 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/**/*.stories.tsx'],
5
+
6
+ addons: [
7
+ '@storybook/addon-links',
8
+ '@storybook/addon-essentials',
9
+ '@storybook/addon-onboarding',
10
+ '@storybook/addon-interactions',
11
+ '@chromatic-com/storybook'
12
+ ],
13
+
14
+ framework: {
15
+ name: '@storybook/react-vite',
16
+ options: {},
17
+ },
18
+
19
+ docs: {},
20
+
21
+ typescript: {
22
+ reactDocgen: 'react-docgen-typescript'
23
+ }
24
+ };
25
+ export default config;
@@ -0,0 +1,24 @@
1
+ import type { Preview } from '@storybook/react';
2
+
3
+ import '../index.scss';
4
+
5
+ const preview: Preview = {
6
+ parameters: {
7
+ actions: { },
8
+ controls: {
9
+ matchers: {
10
+ color: /(background|color)$/i,
11
+ date: /Date$/i,
12
+ },
13
+ },
14
+ docs: {
15
+ source: {
16
+ language: 'tsx',
17
+ },
18
+ },
19
+ },
20
+
21
+ tags: ['autodocs']
22
+ };
23
+
24
+ export default preview;
Binary file
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ <h1 align="center">FireFlink UI</h1>
2
+
3
+ FireFlink UI is an open-source React component library.
4
+
5
+ ## Installation
6
+
7
+ Install the package in your project directory with:
8
+
9
+ ```bash
10
+ npm install fireflink-ui
11
+ ```
12
+
13
+ ## Documentation
14
+
15
+ [Click Here](https://main--65d5ca6d09c1eaf0731601fc.chromatic.com/)
16
+
17
+ ## Example
18
+
19
+ ```bash
20
+ import { Button } from 'fireflink-ui'
21
+
22
+ ...
23
+ <Button label="Button Label" variant="primary" />
24
+ ...
25
+ ```
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/assets/utils/functionutils.ts","../src/components/button/button.stories.tsx","../src/components/button/button.tsx","../src/components/button/index.ts","../src/components/button/types.ts","../src/hooks/useclickoutside.tsx","../src/utils/checkempty/checkempty.stories.tsx","../src/utils/checkempty/checkempty.ts"],"version":"5.6.2"}
package/index.scss ADDED
File without changes
@@ -0,0 +1 @@
1
+ export declare const isFunction: (functionToCheck: any) => any;
@@ -0,0 +1,7 @@
1
+ import './Button.scss';
2
+ import { ButtonProps } from './types';
3
+ /**
4
+ * Primary UI component for user interaction
5
+ */
6
+ declare const Button: ({ variant, backgroundColor, size, onClick, label, disabled, children, type, className, style, transparentBackground, withIcon, iconName, iconPosition, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Button;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Button from './Button';
3
+ declare const meta: Meta<typeof Button>;
4
+ type Story = StoryObj<typeof Button>;
5
+ export declare const Primary: Story;
6
+ export declare const Secondary: Story;
7
+ export declare const Danger: Story;
8
+ export declare const Success: Story;
9
+ export declare const ButtonWithIcon: Story;
10
+ export default meta;
@@ -0,0 +1 @@
1
+ export { default } from './Button';
@@ -0,0 +1,68 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ButtonProps {
3
+ /**
4
+ * Variant of the button
5
+ */
6
+ variant: 'primary' | 'secondary' | 'danger' | 'success';
7
+ /**
8
+ * What background color to use
9
+ */
10
+ backgroundColor?: string;
11
+ /**
12
+ * How large should the button be?
13
+ */
14
+ size?: 'small' | 'medium' | 'large';
15
+ /**
16
+ * Button contents
17
+ */
18
+ label?: string;
19
+ /**
20
+ * Type of the button
21
+ */
22
+ type?: 'button' | 'submit';
23
+ disabled?: boolean;
24
+ /**
25
+ * Optional click handler
26
+ */
27
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
28
+ /**
29
+ * Button content
30
+ */
31
+ children?: ReactNode;
32
+ /**
33
+ * Button id
34
+ */
35
+ id?: string;
36
+ /**
37
+ * onSubmit function handler
38
+ */
39
+ onSubmit?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
40
+ /**
41
+ * react ref for the button
42
+ */
43
+ ref?: any;
44
+ /**
45
+ * Classname for the button
46
+ */
47
+ className?: string;
48
+ /**
49
+ * Additional styles for the button
50
+ */
51
+ style?: React.CSSProperties;
52
+ /**
53
+ * Pass true for transparentBackground button
54
+ */
55
+ transparentBackground?: boolean;
56
+ /**
57
+ * Pass true if button should be with icon
58
+ */
59
+ withIcon?: boolean;
60
+ /**
61
+ * Give icon name availble in storybook that to be on left side of button
62
+ */
63
+ iconName?: string;
64
+ /**
65
+ * Give icon name availble in storybook that to be on left side of button
66
+ */
67
+ iconPosition?: 'left' | 'right';
68
+ }
@@ -0,0 +1,4 @@
1
+ import './Icons.scss';
2
+ import { IconProps } from './types';
3
+ declare const Icon: ({ name, height, width, onClick, color, hoverEffect, className, disabled, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
4
+ export default Icon;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Icon from './Icon';
3
+ declare const meta: Meta<typeof Icon>;
4
+ type Story = StoryObj<typeof Icon>;
5
+ export declare const Icons: Story;
6
+ export declare const AllIcons: Story;
7
+ export default meta;
@@ -0,0 +1,2 @@
1
+ declare let Components: any;
2
+ export default Components;
@@ -0,0 +1 @@
1
+ export { default } from './Icon';
@@ -0,0 +1,10 @@
1
+ export interface IconProps {
2
+ name: string;
3
+ className?: string;
4
+ height?: number;
5
+ width?: number;
6
+ color?: string;
7
+ onClick?: (data?: any) => void;
8
+ hoverEffect?: boolean;
9
+ disabled?: boolean;
10
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ToggleProps } from './types';
3
+ import './Toggle.scss';
4
+ declare const Toggle: React.FC<ToggleProps>;
5
+ export default Toggle;
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Toggle from './Toggle';
3
+ declare const meta: Meta<typeof Toggle>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Toggle>;
6
+ export declare const Default: Story;
7
+ export declare const Disabled: Story;
8
+ export declare const Checked: Story;
9
+ export declare const Controlled: Story;
@@ -0,0 +1 @@
1
+ export { default } from './Toggle';
@@ -0,0 +1,22 @@
1
+ export interface ToggleProps {
2
+ /**
3
+ * Optional onChange handler
4
+ */
5
+ onChange?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
6
+ /**
7
+ * Optional disabled state
8
+ */
9
+ disabled?: boolean;
10
+ /**
11
+ * Optional checked state
12
+ */
13
+ checked?: boolean;
14
+ /**
15
+ * Optional id
16
+ */
17
+ id?: string;
18
+ /**
19
+ * What background color to occur upon toggled
20
+ */
21
+ variant?: 'primary' | 'secondary';
22
+ }
@@ -0,0 +1,2 @@
1
+ declare const useClickOutside: (ref: React.RefObject<HTMLElement>, callback: () => void) => void;
2
+ export default useClickOutside;
package/lib/index.d.ts ADDED
@@ -0,0 +1,118 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1, { ReactNode } from 'react';
3
+
4
+ interface ButtonProps {
5
+ /**
6
+ * Variant of the button
7
+ */
8
+ variant: 'primary' | 'secondary' | 'danger' | 'success';
9
+ /**
10
+ * What background color to use
11
+ */
12
+ backgroundColor?: string;
13
+ /**
14
+ * How large should the button be?
15
+ */
16
+ size?: 'small' | 'medium' | 'large';
17
+ /**
18
+ * Button contents
19
+ */
20
+ label?: string;
21
+ /**
22
+ * Type of the button
23
+ */
24
+ type?: 'button' | 'submit';
25
+ disabled?: boolean;
26
+ /**
27
+ * Optional click handler
28
+ */
29
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
30
+ /**
31
+ * Button content
32
+ */
33
+ children?: ReactNode;
34
+ /**
35
+ * Button id
36
+ */
37
+ id?: string;
38
+ /**
39
+ * onSubmit function handler
40
+ */
41
+ onSubmit?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
42
+ /**
43
+ * react ref for the button
44
+ */
45
+ ref?: any;
46
+ /**
47
+ * Classname for the button
48
+ */
49
+ className?: string;
50
+ /**
51
+ * Additional styles for the button
52
+ */
53
+ style?: React.CSSProperties;
54
+ /**
55
+ * Pass true for transparentBackground button
56
+ */
57
+ transparentBackground?: boolean;
58
+ /**
59
+ * Pass true if button should be with icon
60
+ */
61
+ withIcon?: boolean;
62
+ /**
63
+ * Give icon name availble in storybook that to be on left side of button
64
+ */
65
+ iconName?: string;
66
+ /**
67
+ * Give icon name availble in storybook that to be on left side of button
68
+ */
69
+ iconPosition?: 'left' | 'right';
70
+ }
71
+
72
+ /**
73
+ * Primary UI component for user interaction
74
+ */
75
+ declare const Button: ({ variant, backgroundColor, size, onClick, label, disabled, children, type, className, style, transparentBackground, withIcon, iconName, iconPosition, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
76
+
77
+ interface IconProps {
78
+ name: string;
79
+ className?: string;
80
+ height?: number;
81
+ width?: number;
82
+ color?: string;
83
+ onClick?: (data?: any) => void;
84
+ hoverEffect?: boolean;
85
+ disabled?: boolean;
86
+ }
87
+
88
+ declare const Icon: ({ name, height, width, onClick, color, hoverEffect, className, disabled, ...props }: IconProps) => react_jsx_runtime.JSX.Element | null;
89
+
90
+ interface ToggleProps {
91
+ /**
92
+ * Optional onChange handler
93
+ */
94
+ onChange?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
95
+ /**
96
+ * Optional disabled state
97
+ */
98
+ disabled?: boolean;
99
+ /**
100
+ * Optional checked state
101
+ */
102
+ checked?: boolean;
103
+ /**
104
+ * Optional id
105
+ */
106
+ id?: string;
107
+ /**
108
+ * What background color to occur upon toggled
109
+ */
110
+ variant?: 'primary' | 'secondary';
111
+ }
112
+
113
+ declare const Toggle: React$1.FC<ToggleProps>;
114
+
115
+ type valueType = any;
116
+ declare const checkEmpty: (value: valueType) => boolean;
117
+
118
+ export { Button, Icon, Toggle, checkEmpty };