@sydsoft/base 1.47.0 → 1.49.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 (151) hide show
  1. package/README.md +8 -1
  2. package/{dist/esm → _dist}/_lib/baseFunctions.d.ts +0 -1
  3. package/{dist/esm → _dist}/_lib/baseFunctions.js +25 -38
  4. package/{dist/esm → _dist}/_lib/inputMask.js +66 -69
  5. package/{dist/esm → _dist}/_lib/listFunctions.js +12 -13
  6. package/_dist/_lib/storage/cookies.d.ts +4 -0
  7. package/_dist/_lib/storage/cookies.js +33 -0
  8. package/_dist/_lib/storage/encData.js +41 -0
  9. package/{dist/esm → _dist}/_lib/storage/localStorage.js +10 -10
  10. package/{dist/esm → _dist}/_lib/storage/sessionStorage.js +10 -10
  11. package/{dist/esm → _dist}/_lib/useInterval.js +5 -5
  12. package/{dist/esm → _dist}/alert/index.js +28 -30
  13. package/_dist/box/Box.js +14 -0
  14. package/_dist/box/BoxContent.js +5 -0
  15. package/_dist/box/BoxFooter.js +10 -0
  16. package/_dist/box/BoxHeader.js +10 -0
  17. package/_dist/countDown/index.js +92 -0
  18. package/{dist/esm → _dist}/dateTime/index.js +25 -31
  19. package/_dist/form/Button.js +82 -0
  20. package/_dist/form/Checkbox.js +22 -0
  21. package/_dist/form/Dialog.js +53 -0
  22. package/_dist/form/Form.js +10 -0
  23. package/_dist/form/FormOlustur.js +50 -0
  24. package/{dist/esm → _dist}/form/Input.js +57 -56
  25. package/_dist/form/Label.js +7 -0
  26. package/{dist/esm → _dist}/form/SearchableInput.d.ts +0 -1
  27. package/_dist/form/SearchableInput.js +260 -0
  28. package/_dist/form/UploadBase.js +84 -0
  29. package/_dist/grid/index.js +96 -0
  30. package/{dist/esm → _dist}/icon/icons.js +1 -1
  31. package/{dist/esm → _dist}/icon/index.d.ts +1 -1
  32. package/_dist/icon/index.js +34 -0
  33. package/_dist/menu/index.js +50 -0
  34. package/_dist/modal/index.js +64 -0
  35. package/{dist/esm → _dist}/popover/index.js +100 -100
  36. package/_dist/tooltip/index.js +202 -0
  37. package/_lib/baseFunctions.ts +94 -0
  38. package/_lib/inputMask.ts +257 -0
  39. package/_lib/listFunctions.ts +106 -0
  40. package/_lib/storage/cookies.ts +39 -0
  41. package/_lib/storage/encData.ts +41 -0
  42. package/_lib/storage/localStorage.ts +67 -0
  43. package/_lib/storage/sessionStorage.ts +67 -0
  44. package/_lib/useInterval.ts +30 -0
  45. package/alert/index.module.css +119 -0
  46. package/alert/index.tsx +131 -0
  47. package/box/Box.module.css +153 -0
  48. package/box/Box.tsx +33 -0
  49. package/box/BoxContent.tsx +18 -0
  50. package/box/BoxFooter.tsx +25 -0
  51. package/box/BoxHeader.tsx +46 -0
  52. package/box/index.ts +10 -0
  53. package/countDown/index.tsx +116 -0
  54. package/dateTime/index.ts +79 -0
  55. package/form/Button.tsx +143 -0
  56. package/form/Checkbox.tsx +48 -0
  57. package/form/Dialog.tsx +109 -0
  58. package/form/Form.tsx +19 -0
  59. package/form/FormOlustur.tsx +105 -0
  60. package/form/Input.tsx +364 -0
  61. package/form/Label.tsx +20 -0
  62. package/form/SearchableInput.tsx +406 -0
  63. package/form/UploadBase.tsx +133 -0
  64. package/form/index.ts +10 -0
  65. package/form/styles/Button.module.css +145 -0
  66. package/form/styles/Input.module.css +221 -0
  67. package/form/styles/Label.module.css +31 -0
  68. package/form/styles/SearchableInput.module.css +80 -0
  69. package/global.d.ts +9 -0
  70. package/grid/index.module.css +805 -0
  71. package/grid/index.tsx +171 -0
  72. package/icon/icons.tsx +33 -0
  73. package/icon/index.tsx +95 -0
  74. package/icon/mui.tsx +5932 -0
  75. package/index.ts +21 -0
  76. package/menu/index.module.css +92 -0
  77. package/menu/index.tsx +143 -0
  78. package/modal/index.module.css +77 -0
  79. package/modal/index.tsx +106 -0
  80. package/npm_recovery_codes.txt +5 -0
  81. package/package.json +18 -11
  82. package/popover/index.module.css +89 -0
  83. package/popover/index.tsx +392 -0
  84. package/tooltip/index.tsx +216 -0
  85. package/tsconfig.json +24 -0
  86. package/dist/esm/_lib/storage/cookies.d.ts +0 -4
  87. package/dist/esm/_lib/storage/cookies.js +0 -34
  88. package/dist/esm/_lib/storage/encData.js +0 -43
  89. package/dist/esm/box/Box.js +0 -15
  90. package/dist/esm/box/BoxContent.js +0 -7
  91. package/dist/esm/box/BoxFooter.js +0 -8
  92. package/dist/esm/box/BoxHeader.js +0 -9
  93. package/dist/esm/countDown/index.js +0 -97
  94. package/dist/esm/form/Button.js +0 -76
  95. package/dist/esm/form/Checkbox.js +0 -23
  96. package/dist/esm/form/Dialog.js +0 -40
  97. package/dist/esm/form/Form.js +0 -12
  98. package/dist/esm/form/FormOlustur.js +0 -52
  99. package/dist/esm/form/Label.js +0 -9
  100. package/dist/esm/form/SearchableInput.js +0 -272
  101. package/dist/esm/form/UploadBase.js +0 -86
  102. package/dist/esm/grid/index.js +0 -97
  103. package/dist/esm/icon/index.js +0 -26
  104. package/dist/esm/menu/index.js +0 -52
  105. package/dist/esm/modal/index.js +0 -66
  106. package/dist/esm/tooltip/index.js +0 -119
  107. /package/{dist/esm → _dist}/_lib/inputMask.d.ts +0 -0
  108. /package/{dist/esm → _dist}/_lib/listFunctions.d.ts +0 -0
  109. /package/{dist/esm → _dist}/_lib/storage/encData.d.ts +0 -0
  110. /package/{dist/esm → _dist}/_lib/storage/localStorage.d.ts +0 -0
  111. /package/{dist/esm → _dist}/_lib/storage/sessionStorage.d.ts +0 -0
  112. /package/{dist/esm → _dist}/_lib/useInterval.d.ts +0 -0
  113. /package/{dist/esm → _dist}/alert/index.d.ts +0 -0
  114. /package/{dist/esm → _dist}/alert/index.module.css +0 -0
  115. /package/{dist/esm → _dist}/box/Box.d.ts +0 -0
  116. /package/{dist/esm → _dist}/box/Box.module.css +0 -0
  117. /package/{dist/esm → _dist}/box/BoxContent.d.ts +0 -0
  118. /package/{dist/esm → _dist}/box/BoxFooter.d.ts +0 -0
  119. /package/{dist/esm → _dist}/box/BoxHeader.d.ts +0 -0
  120. /package/{dist/esm → _dist}/box/index.d.ts +0 -0
  121. /package/{dist/esm → _dist}/box/index.js +0 -0
  122. /package/{dist/esm → _dist}/countDown/index.d.ts +0 -0
  123. /package/{dist/esm → _dist}/dateTime/index.d.ts +0 -0
  124. /package/{dist/esm → _dist}/form/Button.d.ts +0 -0
  125. /package/{dist/esm → _dist}/form/Checkbox.d.ts +0 -0
  126. /package/{dist/esm → _dist}/form/Dialog.d.ts +0 -0
  127. /package/{dist/esm → _dist}/form/Form.d.ts +0 -0
  128. /package/{dist/esm → _dist}/form/FormOlustur.d.ts +0 -0
  129. /package/{dist/esm → _dist}/form/Input.d.ts +0 -0
  130. /package/{dist/esm → _dist}/form/Label.d.ts +0 -0
  131. /package/{dist/esm → _dist}/form/UploadBase.d.ts +0 -0
  132. /package/{dist/esm → _dist}/form/index.d.ts +0 -0
  133. /package/{dist/esm → _dist}/form/index.js +0 -0
  134. /package/{dist/esm → _dist}/form/styles/Button.module.css +0 -0
  135. /package/{dist/esm → _dist}/form/styles/Input.module.css +0 -0
  136. /package/{dist/esm → _dist}/form/styles/Label.module.css +0 -0
  137. /package/{dist/esm → _dist}/form/styles/SearchableInput.module.css +0 -0
  138. /package/{dist/esm → _dist}/grid/index.d.ts +0 -0
  139. /package/{dist/esm → _dist}/grid/index.module.css +0 -0
  140. /package/{dist/esm → _dist}/icon/icons.d.ts +0 -0
  141. /package/{dist/esm → _dist}/icon/mui.d.ts +0 -0
  142. /package/{dist/esm → _dist}/icon/mui.js +0 -0
  143. /package/{dist/esm → _dist}/index.d.ts +0 -0
  144. /package/{dist/esm → _dist}/index.js +0 -0
  145. /package/{dist/esm → _dist}/menu/index.d.ts +0 -0
  146. /package/{dist/esm → _dist}/menu/index.module.css +0 -0
  147. /package/{dist/esm → _dist}/modal/index.d.ts +0 -0
  148. /package/{dist/esm → _dist}/modal/index.module.css +0 -0
  149. /package/{dist/esm → _dist}/popover/index.d.ts +0 -0
  150. /package/{dist/esm → _dist}/popover/index.module.css +0 -0
  151. /package/{dist/esm → _dist}/tooltip/index.d.ts +0 -0
package/grid/index.tsx ADDED
@@ -0,0 +1,171 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import styles from './index.module.css';
4
+
5
+ // Row Component
6
+ export type typeSpacingValues = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
7
+ export type typeJustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
8
+ export type typeAlignItems = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';
9
+ export type typeAlignContent = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
10
+
11
+ export interface RowProps {
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
16
+ flexWrap?: 'wrap' | 'wrap-reverse' | 'nowrap';
17
+ justifyContent?: typeJustifyContent;
18
+ alignContent?: typeAlignContent;
19
+ alignItems?: typeAlignItems;
20
+ rowSpacing?: typeSpacingValues;
21
+ colSpacing?: typeSpacingValues;
22
+ }
23
+
24
+ export const Row: React.FC<RowProps> = ({
25
+ children,
26
+ className = '',
27
+ style,
28
+ flexDirection = 'row',
29
+ flexWrap = 'wrap',
30
+ justifyContent = 'flex-start',
31
+ alignContent = 'center',
32
+ alignItems = 'center',
33
+ rowSpacing = 2,
34
+ colSpacing = 2,
35
+ ...other
36
+ }) => {
37
+ const classes = [
38
+ styles.row,
39
+ rowSpacing !== undefined && styles[`row-spacing-${rowSpacing}`],
40
+ colSpacing !== undefined && styles[`col-spacing-${colSpacing}`],
41
+ flexDirection !== 'row' && styles[`flex-${flexDirection.replace('-', '-')}`],
42
+ flexWrap !== 'wrap' && styles[`flex-${flexWrap}`],
43
+ justifyContent !== 'flex-start' && styles[`justify-${justifyContent.replace('flex-', '').replace('space-', '')}`],
44
+ alignItems !== 'center' && styles[`align-items-${alignItems.replace('flex-', '')}`],
45
+ alignContent !== 'center' && styles[`align-content-${alignContent.replace('flex-', '')}`],
46
+ className
47
+ ]
48
+ .filter(Boolean)
49
+ .join(' ');
50
+
51
+ return (
52
+ <div className={classes} style={style} {...other}>
53
+ {children}
54
+ </div>
55
+ );
56
+ };
57
+
58
+ // Col Component
59
+ export type GridValues = 'auto' | 'full' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
60
+
61
+ export interface ColProps {
62
+ children?: React.ReactNode;
63
+ className?: string;
64
+ style?: React.CSSProperties;
65
+ xs?: GridValues;
66
+ sm?: GridValues;
67
+ md?: GridValues;
68
+ lg?: GridValues;
69
+ xl?: GridValues;
70
+ xxl?: GridValues;
71
+ }
72
+
73
+ export const Col: React.FC<ColProps> = ({ children, className = '', style, xs, sm, md, lg, xl, xxl, ...other }) => {
74
+ // Cascading logic - aynı sizin component'inizdeki gibi
75
+
76
+ const classes = [
77
+ styles.col,
78
+ // Sadece belirtilen breakpoint'ler için class ekle
79
+ xs && styles[`col-xs-${xs}`],
80
+ sm && styles[`col-sm-${sm}`],
81
+ md && styles[`col-md-${md}`],
82
+ lg && styles[`col-lg-${lg}`],
83
+ xl && styles[`col-xl-${xl}`],
84
+ xxl && styles[`col-xxl-${xxl}`],
85
+ className
86
+ ]
87
+ .filter(Boolean)
88
+ .join(' ');
89
+
90
+ return (
91
+ <div className={classes} style={style} {...other}>
92
+ {children}
93
+ </div>
94
+ );
95
+ };
96
+
97
+ // Hidden Component
98
+ export interface HiddenProps {
99
+ children: React.ReactElement;
100
+ hidden?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
101
+ onlyHidden?: ('xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl')[];
102
+ }
103
+
104
+ export const Hidden: React.FC<HiddenProps> = ({ children, hidden, onlyHidden, ...other }) => {
105
+ const existingClassName = children.props.className || '';
106
+ const hiddenClasses: string[] = [];
107
+
108
+ if (onlyHidden) {
109
+ onlyHidden.forEach((breakpoint) => {
110
+ hiddenClasses.push(styles[`hidden-${breakpoint}`]);
111
+ });
112
+ } else if (hidden) {
113
+ // Orijinal mantık: seçilen breakpoint ve altındaki tüm breakpoint'ler gizlenir
114
+ const breakpoints = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
115
+ const targetIndex = breakpoints.indexOf(hidden);
116
+
117
+ if (targetIndex !== -1) {
118
+ for (let i = 0; i <= targetIndex; i++) {
119
+ hiddenClasses.push(styles[`hidden-${breakpoints[i]}`]);
120
+ }
121
+ }
122
+ }
123
+
124
+ const newClassName = [existingClassName, ...hiddenClasses].filter(Boolean).join(' ');
125
+
126
+ return React.cloneElement(children, {
127
+ className: newClassName,
128
+ ...other
129
+ });
130
+ };
131
+
132
+
133
+ export const DevelopGridComponent: React.FC = () => {
134
+ const [currentBreakpoint, setCurrentBreakpoint] = useState('');
135
+
136
+ // Breakpoint detector
137
+ React.useEffect(() => {
138
+ const updateBreakpoint = () => {
139
+ const width = window.innerWidth;
140
+ let breakpoint = '';
141
+ if (width <= 576) breakpoint = 'XS (≤576px)';
142
+ else if (width <= 768) breakpoint = 'SM (577-768px)';
143
+ else if (width <= 992) breakpoint = 'MD (769-992px)';
144
+ else if (width <= 1200) breakpoint = 'LG (993-1200px)';
145
+ else if (width <= 1400) breakpoint = 'XL (1201-1400px)';
146
+ else breakpoint = 'XXL (≥1401px)';
147
+ setCurrentBreakpoint(breakpoint);
148
+ };
149
+
150
+ updateBreakpoint();
151
+ window.addEventListener('resize', updateBreakpoint);
152
+ return () => window.removeEventListener('resize', updateBreakpoint);
153
+ }, []);
154
+
155
+ return (
156
+ <div
157
+ style={{
158
+ position: 'fixed',
159
+ bottom: '10px',
160
+ right: '10px',
161
+ background: '#333',
162
+ color: 'white',
163
+ padding: '10px',
164
+ borderRadius: '4px',
165
+ zIndex: 9999999
166
+ }}
167
+ >
168
+ Current: {currentBreakpoint}
169
+ </div>
170
+ );
171
+ };
package/icon/icons.tsx ADDED
@@ -0,0 +1,33 @@
1
+ export const iconMap = {
2
+ close: {
3
+ viewBox: '0 -960 960 960',
4
+ content: (
5
+ <>
6
+ <path d="m336-280-56-56 144-144-144-143 56-56 144 144 143-144 56 56-144 143 144 144-56 56-143-144-144 144Z" />
7
+ </>
8
+ )
9
+ },
10
+ search: {
11
+ viewBox: '0 0 24 24',
12
+ content: (
13
+ <>
14
+ <path d="M0 0h24v24H0V0z" fill="none" />
15
+ <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
16
+ </>
17
+ )
18
+ },
19
+ edit: {
20
+ viewBox: '0 -960 960 960',
21
+ content: (
22
+ <path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z" />
23
+ )
24
+ },
25
+ keyboard_arrow_up: {
26
+ viewBox: '0 -960 960 960',
27
+ content: <path d="M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z" />
28
+ },
29
+ keyboard_arrow_down: {
30
+ viewBox: '0 -960 960 960',
31
+ content: <path d="M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z" />
32
+ }
33
+ };
package/icon/index.tsx ADDED
@@ -0,0 +1,95 @@
1
+ // https://fonts.google.com/icons adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
2
+ // https://icons8.com/icons/set/google-drive adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
3
+ // https://www.svgrepo.com/svg/353811/google-drive?edit=true adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
4
+
5
+ import React from 'react';
6
+ import { iconMap } from './icons';
7
+ import { MaterialIconName } from './mui';
8
+
9
+ export const iconList = Object.keys(iconMap) as IconName[];
10
+ export type IconName = keyof typeof iconMap;
11
+
12
+ interface BaseProps {
13
+ color?: string;
14
+ fontSize?: number | string;
15
+ style?: React.CSSProperties;
16
+ className?: string;
17
+ [key: string]: any;
18
+ }
19
+
20
+ // name ile customIcon mutually exclusive
21
+ interface NameIconProps extends BaseProps {
22
+ name: IconName;
23
+ customIcon?: never;
24
+ iconMui?: never;
25
+ }
26
+ export type CustomIcon = { viewBox: string; content: React.ReactNode };
27
+ interface CustomIconProps extends BaseProps {
28
+ customIcon: CustomIcon;
29
+ name?: never;
30
+ iconMui?: never;
31
+ }
32
+
33
+ // materialIcon ekleme
34
+ interface MUIIconProps extends BaseProps {
35
+ iconMui: MaterialIconName;
36
+ name?: never;
37
+ customIcon?: never;
38
+ }
39
+
40
+ export type Props = NameIconProps | MUIIconProps | CustomIconProps;
41
+
42
+ const defaultIconStyle: React.CSSProperties = {
43
+ userSelect: 'none',
44
+ width: '1em',
45
+ height: '1em',
46
+ // display: 'inline-block',
47
+ verticalAlign: 'middle',
48
+ flexShrink: 0,
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center'
52
+ };
53
+
54
+ export const Icon: React.FC<Props> = ({ name, iconMui, customIcon, fontSize, color, className, style, ...other }) => {
55
+ if (iconMui) {
56
+ return (
57
+ <span
58
+ className={`material-icons ${className || ''}`}
59
+ style={{
60
+ ...defaultIconStyle,
61
+ ...style,
62
+ fontSize: fontSize || '1.3rem',
63
+ color: color || 'inherit'
64
+ }}
65
+ aria-hidden="true"
66
+ {...other}
67
+ >
68
+ {iconMui}
69
+ </span>
70
+ );
71
+ }
72
+
73
+ const iconComponent = name ? iconMap[name] : customIcon;
74
+
75
+ if (!iconComponent) {
76
+ return <span>⚠️</span>;
77
+ }
78
+
79
+ return (
80
+ <span
81
+ className={className}
82
+ style={{
83
+ ...defaultIconStyle,
84
+ ...style,
85
+ fontSize: fontSize || '1.5rem',
86
+ color: color || 'inherit'
87
+ }}
88
+ {...other}
89
+ >
90
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox={iconComponent.viewBox} fill={'currentColor'} width="1em" height="1em" style={{ display: 'block', flexShrink: 0 }}>
91
+ {iconComponent.content}
92
+ </svg>
93
+ </span>
94
+ );
95
+ };