@dev-blinq/ui-systems 1.0.0 → 1.0.2

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 (55) hide show
  1. package/index.html +1 -0
  2. package/package.json +11 -2
  3. package/public/colors.css +4 -0
  4. package/src/components/CustomButton/CustomButton.tsx +12 -7
  5. package/src/components/CustomButton/CustomButtonProps.ts +4 -4
  6. package/src/components/CustomButton/CustomButtonTypes.ts +26 -10
  7. package/src/components/CustomButton/css/color/default.css +83 -53
  8. package/src/components/CustomButton/css/color/disabled.css +44 -23
  9. package/src/components/CustomButton/css/color/focused.css +2 -2
  10. package/src/components/CustomButton/css/color/hover.css +39 -39
  11. package/src/components/CustomButton/css/customButton.css +0 -1
  12. package/src/components/CustomButton/css/index.css +6 -0
  13. package/src/components/CustomButton/css/size.css +23 -23
  14. package/src/components/CustomCheckbox.tsx +3 -3
  15. package/src/components/CustomInput/ChooseInput.tsx +36 -0
  16. package/src/components/CustomInput/CustomInput.tsx +43 -0
  17. package/src/components/CustomInput/CustomInputProps.ts +40 -0
  18. package/src/components/CustomInput/css/index.css +7 -0
  19. package/src/components/CustomInput/css/input.css +76 -0
  20. package/src/components/CustomInput/css/size.css +3 -0
  21. package/src/components/CustomInput/css/state/disabled.css +5 -0
  22. package/src/components/CustomInput/css/state/error.css +3 -0
  23. package/src/components/CustomInput/css/state/filled.css +0 -0
  24. package/src/components/CustomInput/css/state/focused.css +6 -0
  25. package/src/components/CustomInput/css/state/hover.css +5 -0
  26. package/src/components/CustomInput/types/Action.tsx +34 -0
  27. package/src/components/CustomInput/types/CreditCard.tsx +25 -0
  28. package/src/components/CustomInput/types/Currency.tsx +68 -0
  29. package/src/components/CustomInput/types/Date.tsx +20 -0
  30. package/src/components/CustomInput/types/Link.tsx +32 -0
  31. package/src/components/CustomInput/types/Number.tsx +23 -0
  32. package/src/components/CustomInput/types/Password.tsx +30 -0
  33. package/src/components/CustomInput/types/Telephone.tsx +0 -0
  34. package/src/components/CustomInput/types/Text.tsx +27 -0
  35. package/src/components/Typography/Typography.tsx +14 -12
  36. package/src/components/Typography/css/bold.css +20 -1
  37. package/src/components/Typography/css/category/display.css +20 -0
  38. package/src/components/Typography/css/category/heading.css +41 -0
  39. package/src/components/Typography/css/category/text.css +48 -0
  40. package/src/components/Typography/css/index.css +4 -0
  41. package/src/icons/details.tsx +10 -0
  42. package/src/icons/index.tsx +2 -0
  43. package/src/icons/lock.tsx +29 -0
  44. package/src/icons/mail.svg +4 -0
  45. package/src/icons/mail.tsx +23 -0
  46. package/src/icons/password-eye.tsx +10 -0
  47. package/src/index.ts +3 -3
  48. package/src/playground/App.tsx +32 -31
  49. package/src/playground/main.tsx +4 -4
  50. package/src/svg.d.ts +5 -0
  51. package/tsup.config.ts +10 -0
  52. package/src/components/CustomInput.tsx +0 -22
  53. package/src/components/Typography/css/size.css +0 -1
  54. package/vite.config.ts +0 -28
  55. /package/{public/font.css → src/components/CustomInput/css/state/default.css} +0 -0
@@ -0,0 +1,23 @@
1
+ interface MailIconProps {
2
+ style?: React.CSSProperties;
3
+ }
4
+
5
+ export const MailIcon = ({ style }: MailIconProps) => (
6
+ // edited the svg to style it with the props
7
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" style={style}>
8
+ <path
9
+ d="M17.5 12.5786C17.5 14.8829 15.9627 16.7559 13.6819 16.7503H6.31811C4.0373 16.7559 2.5 14.8829 2.5 12.5786V7.42754C2.5 5.12565 4.0373 3.25024 6.31811 3.25024H13.6819C15.9627 3.25024 17.5 5.12565 17.5 7.42754V12.5786Z"
10
+ stroke="#939197"
11
+ strokeWidth="2"
12
+ strokeLinecap="round"
13
+ strokeLinejoin="round"
14
+ />
15
+ <path
16
+ d="M14.4267 7.63843L11.0943 10.3482C10.4667 10.8468 9.57726 10.8468 8.94968 10.3482L5.58887 7.63843"
17
+ stroke="#939197"
18
+ strokeWidth="2"
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ />
22
+ </svg>
23
+ );
@@ -0,0 +1,10 @@
1
+ export const PasswordEyeIcon = () => {
2
+ return (
3
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <path
5
+ d="M4.44393 2.49455C4.36161 2.40174 4.26167 2.3262 4.14993 2.2723C4.0382 2.2184 3.91687 2.18722 3.79299 2.18055C3.66911 2.17389 3.54514 2.19188 3.42826 2.23348C3.31138 2.27508 3.20392 2.33946 3.11211 2.4229C3.0203 2.50634 2.94596 2.60716 2.89341 2.71954C2.84085 2.83192 2.81112 2.95361 2.80594 3.07756C2.80076 3.20152 2.82024 3.32526 2.86324 3.44163C2.90624 3.558 2.9719 3.66468 3.05643 3.75549L4.30643 5.13439C1.61503 6.92658 0.44706 9.49846 0.39081 9.61955C0.337882 9.73955 0.310547 9.86926 0.310547 10.0004C0.310547 10.1316 0.337882 10.2613 0.39081 10.3813C0.419716 10.4453 1.10409 11.9641 2.61659 13.4758C4.63847 15.4953 7.18769 16.5625 10.0002 16.5625C11.3671 16.5701 12.7217 16.3045 13.9846 15.7813L15.5541 17.5078C15.7222 17.6884 15.9547 17.7954 16.2011 17.8057C16.4476 17.816 16.6882 17.7288 16.8708 17.5628C17.0534 17.3969 17.1632 17.1657 17.1764 16.9194C17.1897 16.6731 17.1053 16.4314 16.9416 16.2469L4.44393 2.49455ZM10.0002 14.6875C7.68847 14.6875 5.66659 13.8492 3.99159 12.1969C3.33273 11.5445 2.7658 10.8054 2.30643 10C2.71815 9.27267 3.7744 7.66408 5.58768 6.53986L12.626 14.2828C11.7772 14.5539 10.8912 14.6904 10.0002 14.6875ZM19.6096 10.3813C19.5814 10.4445 18.9064 11.9438 17.4221 13.4406C17.3371 13.535 17.2338 13.6111 17.1185 13.6643C17.0032 13.7175 16.8783 13.7468 16.7513 13.7503C16.6244 13.7538 16.4981 13.7315 16.38 13.6847C16.2619 13.6378 16.1546 13.5675 16.0646 13.478C15.9745 13.3885 15.9036 13.2816 15.8561 13.1638C15.8086 13.046 15.7855 12.9198 15.7882 12.7929C15.791 12.6659 15.8195 12.5408 15.8721 12.4252C15.9246 12.3096 16.0001 12.2059 16.0939 12.1203C16.7175 11.4864 17.2554 10.7735 17.6939 10C17.2348 9.19443 16.6679 8.45531 16.0088 7.80314C14.333 6.1508 12.3119 5.31252 10.0002 5.31252C9.73847 5.31252 9.47675 5.32346 9.21894 5.34533C9.0947 5.35864 8.96905 5.34698 8.84938 5.31104C8.72971 5.27509 8.61844 5.21559 8.52209 5.13602C8.42575 5.05646 8.34628 4.95844 8.28837 4.84772C8.23045 4.737 8.19525 4.61583 8.18483 4.49131C8.17442 4.3668 8.189 4.24145 8.22772 4.12265C8.26644 4.00385 8.32851 3.89399 8.4103 3.79953C8.49208 3.70506 8.59193 3.6279 8.70396 3.57257C8.816 3.51725 8.93796 3.48488 9.06269 3.47736C9.36972 3.4508 9.68769 3.43752 10.0002 3.43752C12.8127 3.43752 15.3619 4.50549 17.3822 6.52502C18.8939 8.03674 19.5783 9.55627 19.6072 9.61955C19.6605 9.73938 19.6882 9.86901 19.6887 10.0002C19.6891 10.1313 19.6621 10.2611 19.6096 10.3813Z"
6
+ fill="#080808"
7
+ />
8
+ </svg>
9
+ );
10
+ };
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { default as Button } from './components/CustomButton/CustomButton';
2
- export { default as CustomInput } from './components/CustomInput';
3
- export { default as CustomCheckbox } from './components/CustomCheckbox';
1
+ export { default as Button } from "./components/CustomButton/CustomButton";
2
+ export { default as CustomInput } from "./components/CustomInput/CustomInput";
3
+ export { default as CustomCheckbox } from "./components/CustomCheckbox";
@@ -1,11 +1,16 @@
1
1
  import React, { useState } from "react";
2
2
  import { Button, CustomInput, CustomCheckbox } from "../";
3
- import { ButtonSize, ButtonColorHierarchyType, buttonColorHierarchyArray } from "../components/CustomButton/CustomButtonTypes";
4
-
3
+ import TypographyCustom from "../components/Typography/Typography";
4
+ import {
5
+ ButtonSize,
6
+ ButtonColorHierarchyType,
7
+ buttonColorHierarchyArray,
8
+ } from "../components/CustomButton/CustomButtonTypes";
9
+ import { MailIcon } from "../icons/index";
5
10
 
6
11
  function extractPossibleChoices(type: ButtonColorHierarchyType): string[] {
7
- console.log(type);
8
- return [...new Set(type.split('|').map(t => t.trim()))];
12
+ console.log(type);
13
+ return [...new Set(type.split("|").map((t) => t.trim()))];
9
14
  }
10
15
 
11
16
  const App: React.FC = () => {
@@ -24,11 +29,7 @@ const App: React.FC = () => {
24
29
  <h2 className="controls-title">Controls</h2>
25
30
  <div className="control-item">
26
31
  <label htmlFor="size">Size</label>
27
- <select
28
- id="size"
29
- value={size}
30
- onChange={(e) => setSize(e.target.value as "sm" | "md" | "lg")}
31
- >
32
+ <select id="size" value={size} onChange={(e) => setSize(e.target.value as "sm" | "md" | "lg")}>
32
33
  <option value="sm">Small</option>
33
34
  <option value="md">Medium</option>
34
35
  <option value="lg">Large</option>
@@ -42,31 +43,23 @@ const App: React.FC = () => {
42
43
  id="colorHierarchy"
43
44
  value={colorHierarchy}
44
45
  onChange={(e) => setColorHierarchy(e.target.value as ButtonColorHierarchyType)}
45
- >
46
+ >
46
47
  {buttonColorHierarchyArray.map((colorHierarchy, index) => (
47
- <option key={index} value={colorHierarchy}>{colorHierarchy}</option>
48
+ <option key={index} value={colorHierarchy}>
49
+ {colorHierarchy}
50
+ </option>
48
51
  ))}
49
- </select>
52
+ </select>
50
53
  </div>
51
54
 
52
55
  <div className="control-item">
53
56
  <label htmlFor="disabled">Disabled</label>
54
- <input
55
- type="checkbox"
56
- id="disabled"
57
- checked={disabled}
58
- onChange={(e) => setDisabled(e.target.checked)}
59
- />
57
+ <input type="checkbox" id="disabled" checked={disabled} onChange={(e) => setDisabled(e.target.checked)} />
60
58
  </div>
61
59
 
62
60
  <div className="control-item">
63
61
  <label htmlFor="text">Text</label>
64
- <input
65
- type="text"
66
- id="text"
67
- value={text}
68
- onChange={(e) => setText(e.target.value)}
69
- />
62
+ <input type="text" id="text" value={text} onChange={(e) => setText(e.target.value)} />
70
63
  </div>
71
64
  </div>
72
65
 
@@ -77,25 +70,33 @@ const App: React.FC = () => {
77
70
  colorHierarchy={colorHierarchy}
78
71
  disabled={disabled}
79
72
  text={text}
73
+ leftIcon={MailIcon}
80
74
  onClick={() => alert("Button clicked!")}
81
75
  />
82
76
  </div>
83
77
 
84
78
  <div className="mb-4">
79
+ <h2 className="text-xl mb-2">Typography</h2>
80
+ <TypographyCustom category="text" Size="md" bold="semibold">
81
+ This is a custom typography component
82
+ </TypographyCustom>
83
+ </div>
84
+
85
+ <div className="mb-4" style={{ paddingLeft: "3em" }}>
85
86
  <h2 className="text-xl mb-2">Custom Input</h2>
86
87
  <CustomInput
87
88
  value={inputValue}
88
- onChange={setInputValue}
89
+ leftIcon={MailIcon}
90
+ actionLabel="Send"
91
+ errExists={true}
92
+ onChange={(e: any) => setInputValue(e.target.value)}
93
+ label="Label"
89
94
  placeholder="Type here..."
90
95
  />
91
96
  </div>
92
97
  <div className="mb-4">
93
- <h2 className="text-xl mb-2">Custom Checkbox</h2>
94
- <CustomCheckbox
95
- checked={checkboxChecked}
96
- onChange={setCheckboxChecked}
97
- label="Check me"
98
- />
98
+ {/* <h2 className="text-xl mb-2">Custom Checkbox</h2> */}
99
+ {/* <CustomCheckbox checked={checkboxChecked} onChange={setCheckboxChecked} label="Check me" /> */}
99
100
  </div>
100
101
  </div>
101
102
  );
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import App from './App';
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import App from "./App";
4
4
 
5
- ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
5
+ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
6
6
  <React.StrictMode>
7
7
  <App />
8
8
  </React.StrictMode>
package/src/svg.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module "*.svg" {
2
+ import React, { ReactNode } from "react";
3
+ const SVGComponent: any;
4
+ export default SVGComponent;
5
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ format: ["cjs", "esm"], // Build for commonJS and ESmodules
6
+ dts: true, // Generate declaration file (.d.ts)
7
+ splitting: false,
8
+ sourcemap: true,
9
+ clean: true,
10
+ });
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
-
3
- type CustomInputProps = {
4
- value: string;
5
- onChange: (value: string) => void;
6
- placeholder?: string;
7
- disabled?: boolean;
8
- };
9
-
10
- const CustomInput: React.FC<CustomInputProps> = ({ value, onChange, placeholder, disabled }) => {
11
- return (
12
- <input
13
- className="border py-2 px-4 rounded"
14
- value={value}
15
- onChange={(e) => onChange(e.target.value)}
16
- placeholder={placeholder}
17
- disabled={disabled}
18
- />
19
- );
20
- };
21
-
22
- export default CustomInput;
@@ -1 +0,0 @@
1
- /* text size css */
package/vite.config.ts DELETED
@@ -1,28 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
-
4
- export default defineConfig({
5
- plugins: [react()],
6
- build: {
7
- lib: {
8
- entry: 'src/index.ts',
9
- name: 'CustomComponents',
10
- fileName: (format) => `custom-components.${format}.js`
11
- },
12
- rollupOptions: {
13
- external: ['react', 'react-dom'],
14
- output: {
15
- globals: {
16
- react: 'React',
17
- 'react-dom': 'ReactDOM'
18
- }
19
- }
20
- }
21
- },
22
- server: {
23
- port: 3003,
24
- watch: {
25
- usePolling: true,
26
- },
27
- },
28
- });