@ozen-ui/responsive 0.84.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 (173) hide show
  1. package/README.md +26 -0
  2. package/__inner__/cjs/constants/environment/constants/index.js +5 -0
  3. package/__inner__/cjs/constants/environment/constants/isDev.js +5 -0
  4. package/__inner__/cjs/constants/environment/constants/isProduction.js +4 -0
  5. package/__inner__/cjs/constants/environment/index.js +4 -0
  6. package/__inner__/cjs/constants/index.js +4 -0
  7. package/__inner__/cjs/entities/breakpoint.js +2 -0
  8. package/__inner__/cjs/entities/index.js +9 -0
  9. package/__inner__/cjs/entities/orientation.js +4 -0
  10. package/__inner__/cjs/entities/os.js +4 -0
  11. package/__inner__/cjs/entities/scope.js +2 -0
  12. package/__inner__/cjs/entities/type.js +4 -0
  13. package/__inner__/cjs/entities/viewport.js +2 -0
  14. package/__inner__/cjs/fabric/fabric.js +79 -0
  15. package/__inner__/cjs/fabric/index.js +5 -0
  16. package/__inner__/cjs/fabric/infers/base.js +2 -0
  17. package/__inner__/cjs/fabric/infers/breakpoint.js +2 -0
  18. package/__inner__/cjs/fabric/infers/index.js +8 -0
  19. package/__inner__/cjs/fabric/infers/orientation.js +2 -0
  20. package/__inner__/cjs/fabric/infers/os.js +2 -0
  21. package/__inner__/cjs/fabric/infers/type.js +2 -0
  22. package/__inner__/cjs/fabric/infers/viewport.js +2 -0
  23. package/__inner__/cjs/fabric/utils.js +25 -0
  24. package/__inner__/cjs/hooks/index.js +15 -0
  25. package/__inner__/cjs/hooks/useBreakpoint.js +16 -0
  26. package/__inner__/cjs/hooks/useBreakpointObserver.js +19 -0
  27. package/__inner__/cjs/hooks/useDeviceType.js +16 -0
  28. package/__inner__/cjs/hooks/useDeviceTypeObserver.js +19 -0
  29. package/__inner__/cjs/hooks/useOS.js +16 -0
  30. package/__inner__/cjs/hooks/useOSObserver.js +19 -0
  31. package/__inner__/cjs/hooks/useOrientation.js +16 -0
  32. package/__inner__/cjs/hooks/useOrientationObserver.js +19 -0
  33. package/__inner__/cjs/hooks/useSnapshot.js +16 -0
  34. package/__inner__/cjs/hooks/useSnapshotObserver.js +19 -0
  35. package/__inner__/cjs/hooks/useViewport.js +16 -0
  36. package/__inner__/cjs/hooks/useViewportObserver.js +19 -0
  37. package/__inner__/cjs/index.js +4 -0
  38. package/__inner__/cjs/provider/ResponsiveContext.js +16 -0
  39. package/__inner__/cjs/provider/ResponsiveProvider.js +24 -0
  40. package/__inner__/cjs/provider/index.js +6 -0
  41. package/__inner__/cjs/provider/types.js +2 -0
  42. package/__inner__/cjs/store/ResponsiveStore.js +95 -0
  43. package/__inner__/cjs/store/index.js +5 -0
  44. package/__inner__/cjs/store/types.js +2 -0
  45. package/__inner__/cjs/store/utils.js +69 -0
  46. package/__inner__/cjs/ui/ResponsiveNodes/ResponsiveNodes.js +30 -0
  47. package/__inner__/cjs/ui/ResponsiveNodes/index.js +5 -0
  48. package/__inner__/cjs/ui/ResponsiveNodes/types.js +2 -0
  49. package/__inner__/cjs/ui/ResponsiveProps/ResponsiveProps.js +40 -0
  50. package/__inner__/cjs/ui/ResponsiveProps/index.js +5 -0
  51. package/__inner__/cjs/ui/ResponsiveProps/types.js +2 -0
  52. package/__inner__/cjs/ui/index.js +5 -0
  53. package/__inner__/cjs/ui/utils/index.js +5 -0
  54. package/__inner__/cjs/ui/utils/types.js +2 -0
  55. package/__inner__/cjs/ui/utils/utils.js +78 -0
  56. package/__inner__/cjs/user-agent/constants.js +115 -0
  57. package/__inner__/cjs/user-agent/index.js +5 -0
  58. package/__inner__/cjs/user-agent/user-agent-parser.js +92 -0
  59. package/__inner__/esm/constants/environment/constants/index.js +2 -0
  60. package/__inner__/esm/constants/environment/constants/isDev.js +2 -0
  61. package/__inner__/esm/constants/environment/constants/isProduction.js +1 -0
  62. package/__inner__/esm/constants/environment/index.js +1 -0
  63. package/__inner__/esm/constants/index.js +1 -0
  64. package/__inner__/esm/entities/breakpoint.js +1 -0
  65. package/__inner__/esm/entities/index.js +6 -0
  66. package/__inner__/esm/entities/orientation.js +1 -0
  67. package/__inner__/esm/entities/os.js +1 -0
  68. package/__inner__/esm/entities/scope.js +1 -0
  69. package/__inner__/esm/entities/type.js +1 -0
  70. package/__inner__/esm/entities/viewport.js +1 -0
  71. package/__inner__/esm/fabric/fabric.js +75 -0
  72. package/__inner__/esm/fabric/index.js +2 -0
  73. package/__inner__/esm/fabric/infers/base.js +1 -0
  74. package/__inner__/esm/fabric/infers/breakpoint.js +1 -0
  75. package/__inner__/esm/fabric/infers/index.js +5 -0
  76. package/__inner__/esm/fabric/infers/orientation.js +1 -0
  77. package/__inner__/esm/fabric/infers/os.js +1 -0
  78. package/__inner__/esm/fabric/infers/type.js +1 -0
  79. package/__inner__/esm/fabric/infers/viewport.js +1 -0
  80. package/__inner__/esm/fabric/utils.js +21 -0
  81. package/__inner__/esm/hooks/index.js +12 -0
  82. package/__inner__/esm/hooks/useBreakpoint.js +12 -0
  83. package/__inner__/esm/hooks/useBreakpointObserver.js +15 -0
  84. package/__inner__/esm/hooks/useDeviceType.js +12 -0
  85. package/__inner__/esm/hooks/useDeviceTypeObserver.js +15 -0
  86. package/__inner__/esm/hooks/useOS.js +12 -0
  87. package/__inner__/esm/hooks/useOSObserver.js +15 -0
  88. package/__inner__/esm/hooks/useOrientation.js +12 -0
  89. package/__inner__/esm/hooks/useOrientationObserver.js +15 -0
  90. package/__inner__/esm/hooks/useSnapshot.js +12 -0
  91. package/__inner__/esm/hooks/useSnapshotObserver.js +15 -0
  92. package/__inner__/esm/hooks/useViewport.js +12 -0
  93. package/__inner__/esm/hooks/useViewportObserver.js +15 -0
  94. package/__inner__/esm/index.js +1 -0
  95. package/__inner__/esm/provider/ResponsiveContext.js +12 -0
  96. package/__inner__/esm/provider/ResponsiveProvider.js +19 -0
  97. package/__inner__/esm/provider/index.js +3 -0
  98. package/__inner__/esm/provider/types.js +1 -0
  99. package/__inner__/esm/store/ResponsiveStore.js +92 -0
  100. package/__inner__/esm/store/index.js +2 -0
  101. package/__inner__/esm/store/types.js +1 -0
  102. package/__inner__/esm/store/utils.js +62 -0
  103. package/__inner__/esm/ui/ResponsiveNodes/ResponsiveNodes.js +25 -0
  104. package/__inner__/esm/ui/ResponsiveNodes/index.js +2 -0
  105. package/__inner__/esm/ui/ResponsiveNodes/types.js +1 -0
  106. package/__inner__/esm/ui/ResponsiveProps/ResponsiveProps.js +36 -0
  107. package/__inner__/esm/ui/ResponsiveProps/index.js +2 -0
  108. package/__inner__/esm/ui/ResponsiveProps/types.js +1 -0
  109. package/__inner__/esm/ui/index.js +2 -0
  110. package/__inner__/esm/ui/utils/index.js +2 -0
  111. package/__inner__/esm/ui/utils/types.js +1 -0
  112. package/__inner__/esm/ui/utils/utils.js +74 -0
  113. package/__inner__/esm/user-agent/constants.js +112 -0
  114. package/__inner__/esm/user-agent/index.js +2 -0
  115. package/__inner__/esm/user-agent/user-agent-parser.js +89 -0
  116. package/__inner__/types/constants/environment/constants/index.d.ts +2 -0
  117. package/__inner__/types/constants/environment/constants/isDev.d.ts +1 -0
  118. package/__inner__/types/constants/environment/constants/isProduction.d.ts +1 -0
  119. package/__inner__/types/constants/environment/index.d.ts +1 -0
  120. package/__inner__/types/constants/index.d.ts +1 -0
  121. package/__inner__/types/entities/breakpoint.d.ts +21 -0
  122. package/__inner__/types/entities/index.d.ts +6 -0
  123. package/__inner__/types/entities/orientation.d.ts +7 -0
  124. package/__inner__/types/entities/os.d.ts +8 -0
  125. package/__inner__/types/entities/scope.d.ts +11 -0
  126. package/__inner__/types/entities/type.d.ts +8 -0
  127. package/__inner__/types/entities/viewport.d.ts +4 -0
  128. package/__inner__/types/fabric/fabric.d.ts +25 -0
  129. package/__inner__/types/fabric/index.d.ts +2 -0
  130. package/__inner__/types/fabric/infers/base.d.ts +2 -0
  131. package/__inner__/types/fabric/infers/breakpoint.d.ts +5 -0
  132. package/__inner__/types/fabric/infers/index.d.ts +5 -0
  133. package/__inner__/types/fabric/infers/orientation.d.ts +4 -0
  134. package/__inner__/types/fabric/infers/os.d.ts +4 -0
  135. package/__inner__/types/fabric/infers/type.d.ts +4 -0
  136. package/__inner__/types/fabric/infers/viewport.d.ts +3 -0
  137. package/__inner__/types/fabric/utils.d.ts +2 -0
  138. package/__inner__/types/hooks/index.d.ts +12 -0
  139. package/__inner__/types/hooks/useBreakpoint.d.ts +2 -0
  140. package/__inner__/types/hooks/useBreakpointObserver.d.ts +2 -0
  141. package/__inner__/types/hooks/useDeviceType.d.ts +2 -0
  142. package/__inner__/types/hooks/useDeviceTypeObserver.d.ts +2 -0
  143. package/__inner__/types/hooks/useOS.d.ts +2 -0
  144. package/__inner__/types/hooks/useOSObserver.d.ts +2 -0
  145. package/__inner__/types/hooks/useOrientation.d.ts +2 -0
  146. package/__inner__/types/hooks/useOrientationObserver.d.ts +2 -0
  147. package/__inner__/types/hooks/useSnapshot.d.ts +2 -0
  148. package/__inner__/types/hooks/useSnapshotObserver.d.ts +3 -0
  149. package/__inner__/types/hooks/useViewport.d.ts +2 -0
  150. package/__inner__/types/hooks/useViewportObserver.d.ts +2 -0
  151. package/__inner__/types/index.d.ts +1 -0
  152. package/__inner__/types/provider/ResponsiveContext.d.ts +8 -0
  153. package/__inner__/types/provider/ResponsiveProvider.d.ts +4 -0
  154. package/__inner__/types/provider/index.d.ts +3 -0
  155. package/__inner__/types/provider/types.d.ts +6 -0
  156. package/__inner__/types/store/ResponsiveStore.d.ts +16 -0
  157. package/__inner__/types/store/index.d.ts +2 -0
  158. package/__inner__/types/store/types.d.ts +12 -0
  159. package/__inner__/types/store/utils.d.ts +5 -0
  160. package/__inner__/types/ui/ResponsiveNodes/ResponsiveNodes.d.ts +4 -0
  161. package/__inner__/types/ui/ResponsiveNodes/index.d.ts +2 -0
  162. package/__inner__/types/ui/ResponsiveNodes/types.d.ts +6 -0
  163. package/__inner__/types/ui/ResponsiveProps/ResponsiveProps.d.ts +5 -0
  164. package/__inner__/types/ui/ResponsiveProps/index.d.ts +2 -0
  165. package/__inner__/types/ui/ResponsiveProps/types.d.ts +8 -0
  166. package/__inner__/types/ui/index.d.ts +2 -0
  167. package/__inner__/types/ui/utils/index.d.ts +2 -0
  168. package/__inner__/types/ui/utils/types.d.ts +6 -0
  169. package/__inner__/types/ui/utils/utils.d.ts +6 -0
  170. package/__inner__/types/user-agent/constants.d.ts +108 -0
  171. package/__inner__/types/user-agent/index.d.ts +2 -0
  172. package/__inner__/types/user-agent/user-agent-parser.d.ts +11 -0
  173. package/package.json +34 -0
@@ -0,0 +1,2 @@
1
+ export * from './ResponsiveNodes';
2
+ export * from './ResponsiveProps';
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ import type { BreakpointKey, Breakpoints, InternalInferBreakpoint, Type } from '../../entities';
2
+ export type BreakpointMap<TBreakpoints extends Breakpoints, Value> = Partial<Record<BreakpointKey<TBreakpoints>, Value>>;
3
+ export type DeviceInfo<TBreakpoints extends Breakpoints> = {
4
+ type: Type;
5
+ size: InternalInferBreakpoint<TBreakpoints>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { BreakpointKey, Breakpoints, Scope } from '../../entities';
2
+ import type { BreakpointMap, DeviceInfo } from './types';
3
+ export declare const resolveBreakpoints: <TBreakpoints extends Breakpoints, Value>(scope: Scope<TBreakpoints>, by: BreakpointMap<TBreakpoints, Value>, device: DeviceInfo<TBreakpoints>) => {
4
+ key: BreakpointKey<TBreakpoints>;
5
+ value: Value;
6
+ } | null;
@@ -0,0 +1,108 @@
1
+ import type { OS, Type } from '../entities';
2
+ declare const UADeviceType: {
3
+ readonly CONSOLE: "console";
4
+ readonly DESKTOP: "desktop";
5
+ readonly EMBEDDED: "embedded";
6
+ readonly MOBILE: "mobile";
7
+ readonly SMARTTV: "smarttv";
8
+ readonly TABLET: "tablet";
9
+ readonly WEARABLE: "wearable";
10
+ readonly XR: "xr";
11
+ };
12
+ declare const OSName: {
13
+ readonly AIX: "AIX";
14
+ readonly AMIGA_OS: "Amiga OS";
15
+ readonly ANDROID: "Android";
16
+ readonly ANDROID_X86: "Android-x86";
17
+ readonly ARCAOS: "ArcaOS";
18
+ readonly ARCH: "Arch";
19
+ readonly BADA: "Bada";
20
+ readonly BEOS: "BeOS";
21
+ readonly BLACKBERRY: "BlackBerry";
22
+ readonly CENTOS: "CentOS";
23
+ readonly CHROME_OS: "Chrome OS";
24
+ readonly CHROMECAST: "Chromecast";
25
+ readonly CHROMECAST_ANDROID: "Chromecast Android";
26
+ readonly CHROMECAST_FUCHSIA: "Chromecast Fuchsia";
27
+ readonly CHROMECAST_LINUX: "Chromecast Linux";
28
+ readonly CHROMECAST_SMARTSPEAKER: "Chromecast SmartSpeaker";
29
+ readonly CONTIKI: "Contiki";
30
+ readonly DEBIAN: "Debian";
31
+ readonly DEEPIN: "Deepin";
32
+ readonly DRAGONFLY: "DragonFly";
33
+ readonly ELEMENTARY_OS: "elementary OS";
34
+ readonly FEDORA: "Fedora";
35
+ readonly FIREFOX_OS: "Firefox OS";
36
+ readonly FREEBSD: "FreeBSD";
37
+ readonly FUCHSIA: "Fuchsia";
38
+ readonly GENTOO: "Gentoo";
39
+ readonly GHOSTBSD: "GhostBSD";
40
+ readonly GNU: "GNU";
41
+ readonly HAIKU: "Haiku";
42
+ readonly HARMONYOS: "HarmonyOS";
43
+ readonly HP_UX: "HP-UX";
44
+ readonly HURD: "Hurd";
45
+ readonly IOS: "iOS";
46
+ readonly JOLI: "Joli";
47
+ readonly KAIOS: "KaiOS";
48
+ readonly KNOPPIX: "Knoppix";
49
+ readonly KUBUNTU: "Kubuntu";
50
+ readonly LINPUS: "Linpus";
51
+ readonly LINSPIRE: "Linspire";
52
+ readonly LINUX: "Linux";
53
+ readonly MACOS: "macOS";
54
+ readonly MAEMO: "Maemo";
55
+ readonly MAGEIA: "Mageia";
56
+ readonly MANDRIVA: "Mandriva";
57
+ readonly MANJARO: "Manjaro";
58
+ readonly MEEGO: "MeeGo";
59
+ readonly MINIX: "Minix";
60
+ readonly MINT: "Mint";
61
+ readonly MORPH_OS: "Morph OS";
62
+ readonly NETBSD: "NetBSD";
63
+ readonly NETRANGE: "NetRange";
64
+ readonly NETTV: "NetTV";
65
+ readonly NINTENDO: "Nintendo";
66
+ readonly OPENHARMONY: "OpenHarmony";
67
+ readonly OPENBSD: "OpenBSD";
68
+ readonly OPENVMS: "OpenVMS";
69
+ readonly OS2: "OS/2";
70
+ readonly PALM: "Palm";
71
+ readonly PC_BSD: "PC-BSD";
72
+ readonly PCLINUXOS: "PCLinuxOS";
73
+ readonly PICO: "Pico";
74
+ readonly PLAN9: "Plan9";
75
+ readonly PLAYSTATION: "PlayStation";
76
+ readonly QNX: "QNX";
77
+ readonly RASPBIAN: "Raspbian";
78
+ readonly REDHAT: "RedHat";
79
+ readonly RIM_TABLET_OS: "RIM Tablet OS";
80
+ readonly RISC_OS: "RISC OS";
81
+ readonly SABAYON: "Sabayon";
82
+ readonly SAILFISH: "Sailfish";
83
+ readonly SERENITYOS: "SerenityOS";
84
+ readonly SERIES40: "Series40";
85
+ readonly SLACKWARE: "Slackware";
86
+ readonly SOLARIS: "Solaris";
87
+ readonly SUSE: "SUSE";
88
+ readonly SYMBIAN: "Symbian";
89
+ readonly TIZEN: "Tizen";
90
+ readonly UBUNTU: "Ubuntu";
91
+ readonly UBUNTU_TOUCH: "Ubuntu Touch";
92
+ readonly UNIX: "Unix";
93
+ readonly VECTORLINUX: "VectorLinux";
94
+ readonly WATCHOS: "watchOS";
95
+ readonly WEBOS: "WebOS";
96
+ readonly WINDOWS: "Windows";
97
+ readonly WINDOWS_CE: "Windows CE";
98
+ readonly WINDOWS_IOT: "Windows IoT";
99
+ readonly WINDOWS_MOBILE: "Windows Mobile";
100
+ readonly WINDOWS_PHONE: "Windows Phone";
101
+ readonly WINDOWS_RT: "Windows RT";
102
+ readonly XBOX: "Xbox";
103
+ readonly XUBUNTU: "Xubuntu";
104
+ readonly ZENWALK: "Zenwalk";
105
+ };
106
+ export declare const USER_AGENT_PARSER_OS_TO_INTERNAL_OS: Record<Exclude<OS, 'unknown'>, (typeof OSName)[keyof typeof OSName][]>;
107
+ export declare const USER_AGENT_PARSER_TYPE_TO_INTERNAL_TYPE: Record<Exclude<Type, 'desktop'>, (typeof UADeviceType)[keyof typeof UADeviceType][]>;
108
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './user-agent-parser';
@@ -0,0 +1,11 @@
1
+ import type { OS, Type } from '../entities';
2
+ export declare class UserAgentParser {
3
+ private userAgent;
4
+ constructor(userAgent?: string);
5
+ update(): void;
6
+ get deviceType(): Type;
7
+ get OSName(): OS;
8
+ private get device();
9
+ private get OS();
10
+ }
11
+ export declare const userAgentParser: UserAgentParser;
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@ozen-ui/responsive",
3
+ "version": "0.84.0",
4
+ "description": "React component library",
5
+ "files": [
6
+ "*"
7
+ ],
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "keywords": [
12
+ "Özen-UI",
13
+ "Bereke Bank UI Kit",
14
+ "Design system",
15
+ "React",
16
+ "React Adaptation Library"
17
+ ],
18
+ "author": "Bereke Bank",
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "ua-parser-js": "2.0.8",
22
+ "@ozen-ui/kit": "0.84.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/lodash.isequal": "^4.5.0"
26
+ },
27
+ "peerDependencies": {
28
+ "react": ">=18.0.0 <19.0.0",
29
+ "react-dom": ">=18.0.0 <19.0.0"
30
+ },
31
+ "main": "./__inner__/cjs/index.js",
32
+ "module": "./__inner__/esm/index.js",
33
+ "types": "./__inner__/types/index.d.ts"
34
+ }